Distant_storm Posted December 31, 2007 Share Posted December 31, 2007 I am using a script that reads the image file and then displays it... if (!isset($_GET['pho']) || !ctype_digit($_GET['pho'])) { header("Content-type: image/jpeg"); $im = imagecreatefromjpeg("No_image_display.jpeg"); imagejpeg($im); imagedestroy($im); } else { $photo_id=$_GET['pho']; if ($dbc = @mysql_connect('lllllll','nnnnn','kkkkkk')) { if (@mysql_select_db('kazphotos')) { $photo_id= mysql_real_escape_string($photo_id); $query="SELECT * FROM photos WHERE Photo_id='$photo_id'"; if ($r= mysql_query ($query)) { while ($row = mysql_fetch_array($r)) { $photo_path="XXXXXXX/XXXXXX/" . $row['Photo']; } } } } header("Content-type: image/jpeg"); $handle = @fopen($photo_path,'r'); while(!feof($handle)) { echo fread($handle, 9000); } } however a page uses this script to call multiple images one by one uusing <img src=image.ph?pho=3> Yet sometimes somewhat random photos don't display, why woudl this be ? Quote Link to comment https://forums.phpfreaks.com/topic/83870-image-not-displaying/ Share on other sites More sharing options...
Distant_storm Posted December 31, 2007 Author Share Posted December 31, 2007 bump Quote Link to comment https://forums.phpfreaks.com/topic/83870-image-not-displaying/#findComment-427009 Share on other sites More sharing options...
Distant_storm Posted January 1, 2008 Author Share Posted January 1, 2008 bump again Quote Link to comment https://forums.phpfreaks.com/topic/83870-image-not-displaying/#findComment-427452 Share on other sites More sharing options...
hitman6003 Posted January 1, 2008 Share Posted January 1, 2008 What are the names of the photo's you are trying to display? What are the differences between the ones that do display, and the ones that don't? Most likely, the ones that don't display have some sort of character that is being "urlized" (space = "%20", etc.). Use urldecode to remove the characters that are being changed. http://www.php.net/urldecode Quote Link to comment https://forums.phpfreaks.com/topic/83870-image-not-displaying/#findComment-427457 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.