asad_black Posted February 12, 2009 Share Posted February 12, 2009 <?php Header("Content-type: image/jpeg"); $var = @$_GET['q'] ; $trimmed = trim($var); $con = mysql_connect("localhost","sample","sample"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("sample", $con); $sql = mysql_query("SELECT * FROM links"); while($row = mysql_fetch_array($sql)) { echo $row['title']; echo "<center><img height='200' width='200' src='".$row['image']."'></img><br><br><br></center>"; //echo "<img src='".$row['imgdata']."'>"; echo $row['link']; echo "<br />"; } mysql_close($con); ?> Quote Link to comment https://forums.phpfreaks.com/topic/144894-solved-retrieve-images-from-database-not-shown-in-firefox-but-show-in-ie/ Share on other sites More sharing options...
uniflare Posted February 12, 2009 Share Posted February 12, 2009 ... Quote Link to comment https://forums.phpfreaks.com/topic/144894-solved-retrieve-images-from-database-not-shown-in-firefox-but-show-in-ie/#findComment-760364 Share on other sites More sharing options...
printf Posted February 12, 2009 Share Posted February 12, 2009 Are the images in the database or just a link to the image? Quote Link to comment https://forums.phpfreaks.com/topic/144894-solved-retrieve-images-from-database-not-shown-in-firefox-but-show-in-ie/#findComment-760365 Share on other sites More sharing options...
uniflare Posted February 12, 2009 Share Posted February 12, 2009 ah i see what youve done. Please explain code, and neaten it up lol - wrap your code in bb tags so its easier to read, but make sure it starts with a <?php. eg: [ code] <?php //some code ?> [/ code] --- basically, you make a php script called "getimg.php", you make it get an image from the database according to an paramters you give it via the URL, eg: getimg.php?img=fduiowehr9832 could be a lovely picture of your dog. After that, you ust change your current page so that ou put that link in there. Quote Link to comment https://forums.phpfreaks.com/topic/144894-solved-retrieve-images-from-database-not-shown-in-firefox-but-show-in-ie/#findComment-760368 Share on other sites More sharing options...
gethinw Posted February 12, 2009 Share Posted February 12, 2009 First, if the php file is creating an html page (which it seems to be) get rid of the Header("Content-type: image/jpeg"); - what you're doing at the moment is telling the browser that you're giving it an image, but then actually sending it html code with an embedded image, which are two different things. Also, you don't need </img>, you just need the <img...> tag, possibly self closing (ie ends with />) depending on what html/xhtml doctype you're using. Quote Link to comment https://forums.phpfreaks.com/topic/144894-solved-retrieve-images-from-database-not-shown-in-firefox-but-show-in-ie/#findComment-760372 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.