Benim web kök klasörü dışında saklanan tüm görüntüleri görüntülemek isteyebilirsiniz. Lütfen bana yardımcı olun. Ben sadece art arda bir resim görüntülemek mümkün duyuyorum. Benim klasöründe 5 görüntüleri varsa Örneğin, yalnızca bir görüntü 5 kez benim tarayıcıda görüntülenir. Bana bu konuda yardımcı olun. Ben şimdi bir ay boyunca bu sorun üzerinde çalışıyoruz. Ben bir acemi değilim. Yardım. Teşekkür ederim. İşte kullanıyorum kodudur.
images.php
<?php   
  // Get our database connector
require("includes/copta.php");
// Grab the data from our people table
$sql = "select * from people";
$result = mysql_query($sql) or die ("Could not access DB: " . mysql_error());
$imgLocation = " /uploadfile/";
while ($row = mysql_fetch_array($result))
{
    $imgName = $row["filename"]; 
    $imgPath = $imgLocation . $imgName;
    echo "<img src=\"call_images.php?imgPath=" . $imgName . "\"  alt=\"\"><br/>";
    echo $row['id'] . " " . $imgName. "<br />";
}
?>
call_images.php
<?php
  // Get our database connector
require("includes/copta.php");
$imgLocation = '/ uploadz/';
$sql = "select * from people";
$result = mysql_query($sql) or 
    die ("Could not access DB: " . mysql_error());   
while ($row = mysql_fetch_array($result)) {
    $imgName = $row["filename"]; 
    $imgPath = $imgLocation . $imgName;
    // Make sure the file exists
    if(!file_exists($imgPath) || !is_file($imgPath)) {
        header('HTTP/1.0 404 Not Found');
        die('The file does not exist');
    }
    // Make sure the file is an image
    $imgData = getimagesize($imgPath);
    if(!$imgData) {
        header('HTTP/1.0 403 Forbidden');
        die('The file you requested is not an image.');
    }
    // Set the appropriate content-type
    // and provide the content-length.
    header("Pragma: public");
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Content-Type: image/jpg");
    header("Content-length: " . filesize($imgPath));
    // Print the image data
    readfile($imgPath);
    exit();
}
?>
 
			