seran128 Posted November 25, 2006 Share Posted November 25, 2006 My Code that displays the image that returns this GIF89a÷ÿtÓAaÇ1b·PY¾,X¾+C§"ØëÞæíðÖëܵè°ãíìÙìàãíí°Úµ®ç¦ÌèÔÅéÄÜìãÔëØ»öˆ¶è±{¾räíî×LÜìä]Ã.×ëÝ~¾t¯ç¨}¾t£ën[À,kÀRáìê^¹NhÈ@U¸-”â_¨ãƒbÂ=Ôÿ¤®ð|M²'ƒÂ|jÆ>œçgU»){ÇimÏ:ßZŽàXÛKn¼^ñþáR¸(¾÷‹Æü“¨íuÊêÌ[À.‡ØWH®%ï{R¸+–àkÚìáÚèé¾ø‹xÅg†ÚWáý¯»òÓÿ¥Äú‘ÀꦩìwnÏnÁOmÅOmÏ9N°*c½JEª$„ÛOÝþ«Ÿåv]Â/R°CãÿÄ}ÖSpÎEÂꩶݺ¼÷‰Þÿ½ÆfÛÿ¶ï|¨ívuÍHÝìåÉý–ŠßVšåg[·LR·)Ðÿ’͉W¼-†ÙWÓþ©iÍ5¸ô„ïzZÀ/žçl«íyïÿº¢á|©ç ªç~öÿÂýÿÉèÿÐÂÞÐìÿÖqÒ>àÿª€¾väÿ®]Ä-Óþ wÓMìÿÓÔÿ¡ÖcžèjÇû”g¿Pc¸Se¹Q€×MÎèÖ}ÆbîþÝÛìâ`¾7vÔBÚéç…ÚU]¼4†ÂÞìçåÿ²ÐèÛÔOuÐD‹Ú`ŽÜb±ì‡bÈ2fË3fË4˜ßlÕþ«ÊäÔÍçÖkÁOÇêÈÕëÚ—äblÌ:nÏ;nÑ;»ìšC¨!²ç¬G¬#Ýý»à]¼êžºô†J¯&žát=£ ‹ÞYaºFåýÌæýÏâÿÇñþä~ÓPzÕGqÊCQ¸*ÃꬦìqjÎ7¶Ü½eÂ:[¹GÝý¼Çý‘|ÅgM´'`µPÜÿ´¶ô‚wÅ[®îzÑçÝ©ív~ÍcwÏI^Ã/Èý–Éý—‰ÝW˜åfÔëÙÍèÔ‚ÆiQ¶)Q¶*yÐJÐþžbÆ1W¼,|ÖI¯Ú´W½,Žß[ÖLÓþ¨L±&hÌ5Íý›I¯$¸õ„®ï|¿é½©íuZÁ,žælçíò!ùÿ,ÿÿ (¤X.%ÎÌü’ôi Ç»€´)Y D&JAÜøï@¦JcŒ:†,Ѓ "+[¯4ÔÖ;™ÒáXYPÐ{•‰+š5€Å¥š88ãp¤:‡r£;D^H±FÃI>`&ì™2MÄœ9PÄj:êÛŒ8%Zxà·„>¼=›TK†Ñ r© ‰N,ܬ3…§'ÊÀ1“jK .ÀV€W½f.ôËÐ(Çñl\ ¦kdÉð©»Ó'@+hLpÝÒ¢gU˜?TtùßKéÜ…cÀ² ó.¼ó”È^»?zœö-€Î€v¶Na"× Instead of an Image.[code]<?header("Content-type: image/gif"); include("include/sitefunctions.php");include("include/connection.php"); $itemid = $_POST['ItemId']; echo $itemid; $info=getpicturecontent($itemid);?><html> <head> <title>Image Display</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .box { font-family: Arial, Helvetica, sans-serif; font-size: 12px; border: 1px solid #000000; } --> </style> </head> <body> <? echo $info;?>[/code]My Function[code]function getpicturecontent($inId){ global $connection; $sql="select * from images where ItemId='$inId'"; echo $sql; $result=mysql_query($sql,$connection) or die(mysql_error()); while($row=mysql_fetch_array($result)) { $getpicturecontent .= "<table width='200' border='0'> <tr> <td>" . $row['content'] . "</td> </tr> <tr> <td></td> </tr> </table>";}return $getpicturecontent;}[/code] Link to comment https://forums.phpfreaks.com/topic/28398-image-mysql-problem/ Share on other sites More sharing options...
JasonLewis Posted November 25, 2006 Share Posted November 25, 2006 i am assuming the data type for the picture in the sql db is a blob. well you must use headers. add this at the top, below <?php[code=php:0]header("Content-type: image/type");[/code]remember to change type to the image type, jpeg or png. Link to comment https://forums.phpfreaks.com/topic/28398-image-mysql-problem/#findComment-130009 Share on other sites More sharing options...
marcus Posted November 25, 2006 Share Posted November 25, 2006 He has that... Link to comment https://forums.phpfreaks.com/topic/28398-image-mysql-problem/#findComment-130012 Share on other sites More sharing options...
JasonLewis Posted November 25, 2006 Share Posted November 25, 2006 haha, shows how much i am concentrating. well try changing the image type or checking to see if the data type is blob. sorry for my very bad reading skills. :) Link to comment https://forums.phpfreaks.com/topic/28398-image-mysql-problem/#findComment-130013 Share on other sites More sharing options...
TEENFRONT Posted November 25, 2006 Share Posted November 25, 2006 hmmm...your sending out image headers but you have html in the file...im not 100% on this, but wouldnt that cause this issue?Try getting rid of the html+ css stuff in the image file, see if this helps? Link to comment https://forums.phpfreaks.com/topic/28398-image-mysql-problem/#findComment-130017 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.