grahamgr3 Posted October 9, 2014 Share Posted October 9, 2014 My show_image.php script is not working. When I click on the links the popup window comes up but the images don't display, only the unavailable.jpg image displays. I checked the uploads folder and it seems ok. I am using the downloaded script from this site to make sure the code is ok. For images.php, and upload_image.php, and functions.js, I am also using this site's scripts. I tried to see the source code from the popup window and there is nothing it is blank. Here is the show_images.php code. <?php # Script 11.5 - show_image.php // This page displays an image. $name = FALSE; // Flag variable: // Check for an image name in the URL: if (isset($_GET['image'])) { // Make sure it has an image's extension: $ext = strtolower ( substr ($_GET['image'], -4)); if (($ext == '.jpg') OR ($ext == 'jpeg') OR ($ext == '.png')) { // Full image path: $image = "../../../../uploads/{$_GET['image']}"; // Check that the image exists and is a file: if (file_exists ($image) && (is_file($image))) { // Set the name as this image: $name = $_GET['image']; } // End of file_exists() IF. } // End of $ext IF. } // End of isset($_GET['image']) IF. // If there was a problem, use the default image: if (!$name) { $image = 'images/unavailable.png'; $name = 'unavailable.png'; } // Get the image information: $info = getimagesize($image); $fs = filesize($image); // Send the content information: header ("Content-Type: {$info['mime']}\n"); header ("Content-Disposition: inline; filename=\"$name\"\n"); header ("Content-Length: $fs\n"); // Send the file: readfile ($image); Link to comment Share on other sites More sharing options...
Larry Posted October 14, 2014 Share Posted October 14, 2014 Could you provide some more information? PHP version? OS? Where the PHP script is (what directory)? Where the images are stored? What URL you're using? Link to comment Share on other sites More sharing options...
Recommended Posts