Jump to content

Displaying file from database.


designedfree4u

Recommended Posts

When i try to display a file from database it shows a bunch of mumbo like this

 

w w w w w w w w ÿØÿàJFIFddÿìDucky<ÿîAdobedÀÿÛ„ ÿÀØØÿÄ« !Q1AaBq"r‘Á2R#¡±‚’¢Ccs“£$bÓ4¤U !1AQaq‘¡±ÁÑ"2BRb¢3ðárÒ#SÿÚ ?µ #žÁã¹,µ’R¿äM[?MPø¶Jמbv™²ÿn–·’&}vç«ý5¶w ™ûg/ð¸åO¦6¸Ã;ÌQ÷$éáÍý¹±[Ϥ{X÷¯J«OýæÞÏø·ìŸ?ÏÃú½RÏÿ”â?õÿU?Ü̶êÿMn]Ã~Ù«ü^8“é‘­>£yŠ~æ øs^|Vói>ÆÅŽÏ`òi\nFÚõ)_ñæŽ]Ÿ ªf®JÛšbQ™¶™±r–¯–&=¬ãí® /šÄáìÝ{•»ŠÊÕ²ÌäbWrWµ|ió{Ö±¬ÎŒû}®Löîc¬Ú݈{VüËã­Üû}1b·¯M‰}wÅ5ÞØ’’9=åi›‰ÄrR5]¸ïm-¸·wö×–}<ÞÔQžêçPóNwÄæf‚~âÑ~ˆ›¿…ÎOyTÉ»Ény\6žÙ`úqÄÏ]¾iõûšŒ’>G«är½îZ¹ÎZª¯Š©®™ˆˆ!ÄñèQÈøÞÊǵj×5h¨¾ ‡¯&"cImØ®u æü6fiáoî.×âX©»ñ8œÔ÷U Œ{¼•æ”6ïû,ÿV8‰ë¯Ë>¯zWÒ_2øë‡2ßSØ­“×bßZqI wº%¬Ou\Haâq<—þ!à{×[míÞý¶äŸO7±0â3XœÅ›oqWq^Ú¿²X\JîZv/‚í$ézÚ5‰ÕIÜmr`·s%f¶ífŸL)êW]ñ:qòc0m'˜m[,•­¼Nç«~Û“îµvw¯q¹ßÅ9+ËeÂxO&æ#&mi‹ú­ðŽßRºj-QžÔwî¿ÌÞIwpµFñ­Ä_,lJ5‰àˆBäËkζ]3e°Ã¶§sb±íòÏKË1¶À¦Õí9~Ûü5ä–— DwÕDòÈÅ«^ž †LymIÖ³£S{°Ã¹§s-bÑìòOBÅô×®øFøñ™ÆÇŒÌ:ŠJÒÞw/sßaË÷\»{—¸šÛoâü–ä³™ñ¿ äÛDäíñU~1Û„¬H)à|sšÖ«œ¨Öµ*ç.ÄDNõb5W~¯uÆKõ›¥gXìR¬¼ÉƪŽ›¹Y ¦Ô{¼ÝÛ;aw›í~Zsuº_‡<+ô͸oö׫¶{{:<¼Ð™½€lé\d°Xpªu’ÅhË<œŠªè{‘“*íX÷;Ëß³²Sg¾Óå¿7Z‰â? ÆMsmãKýÕëíŽÞΟ/=ˆkšæ£š¨æ¹*×&ÔT^ô&œÒcGÐð¾õëªïši´†n#^ ½Ôkµîï·j§•<û×ÙßX}þï_’¾ƒ¤xKÃñXÎX埢:¿wÃÓÔƒ•üN}ê»áš!››Š ƒu"íc»­Ü«åw“rû;©-°Ýéò[ÍðP<[áø´NçrÇ×»ãéëX"aÍÀßZºˆºKNü5Œœ9¼š:;ENØ£M’Mê­ãèSK{¸üuÒ>©Y¼1Á¿™Ÿ½xÿŠœ³Û=øöyU=Îsœ®r«œåªªíUU+ÎãàÖ¹Ír9ª­sV¨©±QP­‡Ezˆº·Nü5ôœY¼b6;µ^Ùc]‘Íë¥ãéBòÜ~Jé?T8÷‰ø7ðó÷©ñ_–;'¦¿Ï"D7UÆi¢†'Í+‘‘FÕ|rÑÖ¥UU|ògGÕk6˜ˆç•1ê.°ŸVêË̳•~]ʱ|–ñª£Ê¿i|UJÎç7ä¼ÙÜx7 žÚ¸þî{vÚyþHkF eéÖ°ŸIjË<³U~ʾ<öò*#ÒêŸi7µjŽk’¨¨¾(Y¢upëVk3ÏG¯zýª†Ð’ÙÂþ¼Ëþ´]©8¦_Bµ8Þ4x†^î=?RÓá ‡çÞE§éÅï?Ûñó*¡_u௠:¡Ù œÏâ»Ã?áUÚ±SŠô#W=ÒÁÃò÷±éú\‡ÅûÁ¼›GÓ–;Þ»ãçIFò¬—æO8ëÍioŠk«*Ù¼MÝ-Çâ9}lå\K&·ÓªWÁ;^æÖrtä·ª¼žÝQ!¹–þ[3Ž³Ö—§:‘emœnùmÿ«êg0‘á¹4¾p¦øÛkßÚÆNœvõ[“ۢͮT¿©yÈëüýÒ­Qof‰‹½»”ÏÙbÍ»Ù-=®çÁ0þ-ž*þÈŸO/½­€6^šdW¯ðH¼(—°ÆõÜÉÊì½LûkwrV{Q|oåÙå¯ì™ôrû—@³¸`Q,Œëq¹¸]«4¯‘WÞr¯ÖTí:ÌËôwiZõD1Ï–@éÖß!mp›Y"/ºäS곤ıæ§z–¯\Jö–ÇçÀ¡’±Y#ؽ­UE¯‚•)~†¬ë¸ž=Ê&+äcµÊˆ”ñSØyiÒ5_2ÚüòwTYºËSe¬Ü”[kˈ•=É\ߨªå®—˜íw݆OɃ¿U+>§˜cmôô½›¯µ.&Í©U¹¼·‰ß•­ú̘«­¢;Z»ü¿K~šZ}¼E©À€£õǸޥeh”Šó—w5‰Æ¿ÔGÝõ;¹gµÙ¼+¸ü» u×Zú'“Õ£B4ÖïC± ’êV*©X¬ù—rør˜¼ ýEi¹±§{,v+Þ*Ü~-…úí¥}3ËêÕn Œ€ó;§UöøEkÊWXÝ;ÁÕ’R*?é"x¦>H·™Ð| ¼Òr`žŸš=“î@;£ŸþX´ê²ß-¨¥m9ªÛWx6’MêUV}Ç ÇÉ6ó9ÏŽ·šÎ<ÑóO²=éØ–sàðõ¾™‹Si\ŽJ#®¢^C×±³1xâw©íJø³âïÒjá{éÚî)–>Ùåòtú”ªæÚ{[™m®±\@÷G4nØ潋Â毊*y'IwZ^/XµgXžXuž>€–ÖÓÝ\ÅmnÅ–âw¶8cn×9ï^µ&ù8šßnÒåš_eíüÊÊV³áœvîË·p®'y†2SÏSÔ×Ì)°hm“ÕÚ‚ MŠpµÞÝÝÊ¥[ (¾ÓÝù‘;Ô̓ ä·vÜW‰ãÙ᜗óG\õ.6 ŽÁâ-q8èùVvŒHâoz÷«œ½îríUÞYqÒ)Xˆæ‡ÝËl—migŸmp±ÔŠÖx7Ø^"Eu_cz‰WÃ%?+]æo¦Š`Ümã-t”·âù69»õå¬ýUëTª6¦Ó5—›—`¹‹j/k$böI¼Í]ÿY\ËŠÔ¶–vmŽûëdÅ:Ö}]“ÚòŒm°zºgLfu.^V"žæ]ª½Œ‰Û$Žòµ7ýfLX­{iV¦û}‹kŽre+¾Èí[žŸhNŒÁ¶ÂÍ[©(ûûÕJ>i)ùß+{½5RÇ·ÛÆ*é3Æ8¾Mö^ý¹+Mz£ã×-œÎ‰®kÖ8¥±ÉÇÃ,uu¥ätæÂõïj¯j/™«±}4S|ÉJO…qlÛ,üsÉÓ^‰ÿ«÷¦Ú‹F^òòó¬$r¥®F$^T›‘~ãéå_USi¸Û[òóuºï ãx7ÔÖ“¥ãž³Ïíj†º\× ºm¨µï/&Â7"]deEåF›“ï¿ý)ë¢m66ûkežNn´Gãx64Öó­çš±Ï?íZ} ðZ;–8Èø¥’Ž»¼’œÙžîTìDòµ6'¦ªOàÁ\q¤9âÙ·¹;ù'“¢½þ:e±™Ñ€é½±³¾µ’ÒöîmfN`•¨ö97+]TSËV&4–LYmŽÑjLÖÑÓK\ü·A;ä½Ò7 ·rÕË‹¹UXëº)v«}¯¼„V~¯-= ç ñ¬Ö"›˜ï~èçóÇÃЄ3Úg?§îÖÓ3a5”ȾÏ1¾Ë©ÞÇ¥Xôñj©“©:Z4_v›ì;š÷±Z-žøç;Ì1¶€§Ó9ýAv–˜k ¯fUö¹mö[^÷½hÆ'‹• ˜ñZó¥cV®ï}‡m^ö[Ec·ÝóæMúåº$Ž÷W\6áÉG&.ÙU#®éeØ®ô2žò’˜8nœ·ô(\WƳhšm£OÝ<þhøúm•¬v–PGmk pÅMF1©¹Ú"µ¬Di \¶Éiµæmié—qëÓyce}nûkÛxî­Ÿ±ðÌÆÈÇzZäTSËV&4–LYoŽÝêLÖÝqÉ(ï=òýÓÜ£Ÿ-´3b¦vÚÚIøuþ\‰#Q<CK'ÇnnE—iã î.KLdݾ˜Ó׫BÊü¯æXç.'5opß+n£|+è«9Õú Kð»tJÅ·ñÞ)þæ;Gúf'ÛÝkw_/=J…ÔŽÚÚå7ÅpÄOîrÌòÇBNž1Ø[žÖ¯–³îÕ…ÿDõWÿ‡ÿ•gþñóü Ý^¸lêøwýŸÓö³m~^z•3©%µµ²o–ኟÛæQòÏC^þ1ØWšÖ·’³ïѲb¾Wó/sW-š··o™¶±¾eôUüš}zp»tÊ3qã¼Qý¼vŸõLG³¼ßp?/Ý=Ź’ÜÃ6Vfí­ÜŸ‡_åÆ‘µSÁÕ6ñðüuçåWw~0Þåä¬Æ8ý±Ëé}Z$K;+v[Y[ÇklÍŒ†667ÐÖ¢"µ¬Di 

 

Here is my code

 

 <link href="iqcontent.css" rel="stylesheet" type="text/css"> <table id="Main" border="1"  cellspacing="0" cellpadding="4" align="center" colspan="1">
<tr>
<th><font size="2"face="Arial, Helvetica, sans-serif">Address</font></th>
<th><font size="2"face="Arial, Helvetica, sans-serif">City</font></th>
<th><font size="2"face="Arial, Helvetica, sans-serif">map</font></th>
<th><font size="2"face="Arial, Helvetica, sans-serif">Bed</font></th>
<th><font size="2"face="Arial, Helvetica, sans-serif">Bath</font></th>
<th><font size="2"face="Arial, Helvetica, sans-serif">Terms</font></th>
<th><font size="2"face="Arial, Helvetica, sans-serif">SQFT</font></th>
<th><font size="2"face="Arial, Helvetica, sans-serif">LSQFT</font></th>
<th><font size="2"face="Arial, Helvetica, sans-serif">Price</font></th>
<th><font size="2"face="Arial, Helvetica, sans-serif">Picture</font></th>
<th><font size="2"face="Arial, Helvetica, sans-serif">File</font></th>
</tr>
<?
$username="";
$password="";
$database="";

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$query="SELECT * FROM Listing";
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();

$i=0;
while ($i < $num) {

$Address=mysql_result($result,$i,"Address");
$City=mysql_result($result,$i,"City");
$Map=mysql_result($result,$i,"Map");
$Bed=mysql_result($result,$i,"Bed");
$Bath=mysql_result($result,$i,"Bath");
$Terms=mysql_result($result,$i,"Terms");
$SQFT=mysql_result($result,$i,"SQFT");
$LSQFT=mysql_result($result,$i,"LSQFT");
$Price=mysql_result($result,$i,"Price");
$Picture=mysql_result($result,$i,"Picture");
$File=mysql_result($result,$i,"File");
?>

<tr>
<td><font size="1" face="Arial, Helvetica, sans-serif"><? echo $Address." ".$last; ?></font></td>
<td><div align="center"><font size="1"face="Arial, Helvetica, sans-serif"><? echo $City; ?></font></td>
<td><div align="center"><font size="1"face="Arial, Helvetica, sans-serif"><? echo $Map; ?></font></td>
<td><div align="center"><font size="1"face="Arial, Helvetica, sans-serif"><? echo $Bed; ?></font></td>
<td><div align="center"><font size="1"face="Arial, Helvetica, sans-serif"><? echo $Bath; ?></font></td>
<td><div align="center"><font size="1"face="Arial, Helvetica, sans-serif"><? echo $Terms; ?></font></td>
<td><div align="center"><font size="1"face="Arial, Helvetica, sans-serif"><? echo $SQFT; ?></font></td>
<td><div align="center"><font size="1"face="Arial, Helvetica, sans-serif"><? echo $LSQFT; ?></font></td>
<td><div align="center"><font size="1"face="Arial, Helvetica, sans-serif"><? echo $Price; ?></font></td>
<td><div align="center"><font size="1"face="Arial, Helvetica, sans-serif"><? echo $File; ?></font></td>
<td><div align="center"><font size="1"face="Arial, Helvetica, sans-serif"><img src=<? echo $Picture; ?>></font></td>
<td><font size="1"face="Arial, Helvetica, sans-serif"><a href="mailto:<? echo $email; ?>">E-mail</a></font></td>
<td><font size="1"face="Arial, Helvetica, sans-serif"><a href="<? echo $web; ?>">Website</a></font></td>

</tr>

<?
$i++;
}


echo "</table>";

 

 

Link to comment
Share on other sites

this is one of a number of reasons why i suggest not storing images in a database. anyway....

 

the problem is that your browser doesn't know what the data means. you'll probably need to make the image a link to a PHP file that pulls the image from the database and then adds the proper headers before sending the image to the browser. alternatively, store image names instead of the images themselves.

Link to comment
Share on other sites

What im trying to do is when a user uploads a pdf it shows up as a link on the results page examples below,

 

form: http://www.jaybirdfolio.com/Listings_Form.htm

 

Results of form: http://www.jaybirdfolio.com/Listings_Results.php

 

As it stands if a person types in the directory of thier image it will show on the results page, but i would like for them to upload to my directory called http://www.jaybirdfolio.com/upload

 

Then, have the pdf,jpg,or, gif  put in the correct row/field that they submitted

 

Is there any tutorials for this?

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.