You are here: image problem « PHP « IT news, forums, messages
image problem

Posted by William Stokes on 03/24/05 19:27

Hello,

I really can't figure this out. Can someone help please. I've wasted hours
already with this one.

I'm trying to print image to a web page using fpassthru. Here's the code:

$name = path/to/the/image/folder/img1.jpeg;
$fp = fopen($name, 'rb');

// send the right headers
header("Content-Type: image/jpeg"); //also tested with type pjpeg
header("Content-Length: " . filesize($name));

// dump the picture
fpassthru($fp);

Help Appeciated. Thanks.
-Will

This code is basically straight from manual. I have verified that the images
path is correct. When I test this I get a browserfull of junk like this:
"Q$pv{:Sd䱧'AסfngqZ;jixY3:f-,mfc>N-ԭn?IU`r6-Ky<
Zۭ-?խ^w1A&doV?ν_ZYb$Ay?9>moKT[/sYU^
ɐK$^[` 'DfY {{>qұ{z4AzXZ}PX]\'\[~~¨>TYm\-asj>qYKǿ?'_Gw;MzI>f>"T
n)<ha.fs'xU4(>Jo>~Ys8P_s1uZ`9EhNR{d
*\Ҭȧ?p,XƼs=Z5edPhy:'?0h?ѩS.}{
\XO+
Y:e"o`VO"wѢε>uU^,ĪEr><Y~C.g-v=Yaq{sO-7"'?w-ud)iJ\ݤ"<OxOo$nY""0'M,nSv>5Ϳ/wvYU.OOL<1ku7-Tis?F*`V8}gTF
l{{H"btKr;L'n\|ioeT̢ͬ@zUߺ Y?u8,B-'?=2s-?W[so7AS#oH,rlka6Ӱzof7~`7z?io,~sn%Y]Tsh@;)}:-f84
/?_V?'üf-?z#\K<|'?<}$B'~~h^BQ<"Wu-
C/z\:<y?uT Zw{.zy"Yjg_v>V5}oK-'eO͍j27cFTNүz*Vzz.[kg䱹M,,-[{:)*{T[$4z'o
YI'kG.G"pFUtM"rYWoXagX6ZvXpkɾ'{[Qo>cmc$W*OO>?g
0^E[}6r.T8pNYN4aG?Y,XsqHkP_-G/0Z
h|?Ho媺1oʱsG?<&a]Qٍ~KfiIH<[F'?"";OC"OZ/
[~%"ZA[eSNS{4~T  ˱>'~8Z:>W
~Yu,-`8ҭQ~p?sSf.9|Ak"r>s`W;v[Ozoǰ,]:nQ?jv]kw>dSL?:-}>>cxolF?Z.,vE'?<a-9c{QsXnp{磻?-
O(ؤOP$9Kc >?> YO`ö<9Vl]?*;~'"~RxZM6??<<mv.=4W3WK\zߤBf
̳ST\9?i'zi4Ay>ho?[1..ʱ=?mOc=
Yhϴ>zZzk7oc2<MpU?js'53K]`YLfS%8?h>qOR&ckuCk7,>N
<#wzSPzf0vKskl\wRN'a,r#GܻMz$|INJ"ޯ^deFnfù(cc:OI-}@Y*a?~YDU}p6c䵿2zy,wg
~A6F+?6p .J.ZZ|,z?mM5IN OVg "15DBZ

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация