php tüm görüntüleri gösteren değil

2 Cevap php

I a writing a gallery app in php. The images are dynamically displayed through php. On each load of the page, not all images are showing. it does this randomly, on each load.

Ben php yeni olduğum gibi, daha önce bu sorunu olmadı. Bu dili kullanırken Perl, hepsi ve ben hiçbir dinamik görüntü görüntü sorunları vardı benim önceki uygulamalar.

check it here: http://dev.system-engine.com/dev/exec/pcli.php?R=%27/Paintings%27&cfg=%22fgal%22

Tüm yardım takdir.

, teşekkür

Jer A

Burada kodun bir kısmı:

function imageThumbLoad($ref) {


$path = FOTOGAL_PORT::$ROOT.$ref;
$path=preg_replace("/\'/","",$path);

$path=preg_replace("/\"/","",$path);

 $path=preg_replace("/\*/"," ",$path);

 $path=preg_replace("/\^/","&",$path);

 $path=preg_replace("/\/([^\/]*)\/\.\./","",$path);



 if(preg_match_all("/\.jpg|\.jpeg/",$path,$tmpmatches))
 {
 header("Content-type: image/jpeg");


  $fh = fopen($path, 'r');
  while (!feof($fh)) {
    $l= fgets($fh, 4096);
    print $l;
  }
  fclose($fh);

 }

2 Cevap

Herşey CTRL + F5 tarayıcınızda vurmak, burada sadece güzel gösterir.

Bu çözmezse web sunucusunu yeniden başlatmayı veya yapılandırma yönergelerini kontrol etmeyi deneyin.

Ben sorunu çözdük düşünüyorum.

bunun yerine 'fgets' of 'fread' kullanın

 $fh = fopen($path, 'r');

 $contents = fread($fh, filesize($path));

 print $contents;