Hi,

Thursday, April 6, 2006, 5:42:05 AM, you wrote:
AB> Hi,

AB> I added image confirmation to a guestbook and even though it works 
AB> greate for most people, some people have problem and I can't seem to 
AB> figure out why this happens. Note that I'm not talking about the same 
AB> guestbook on one server but the guestbook is on people's own hosting server.

AB> The php code to create the image can't be simpler:

AB> *confirm_image.php:*
AB>         $datekey = date("F j");
AB>         $rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $cfg_sitekey . 
AB> $random_num . $datekey));
AB>         $code = substr($rcode, 2, 6);
AB>         $image = ImageCreateFromJPEG("images/code_bg.jpg");
AB>         $text_color = ImageColorAllocate($image, 80, 80, 80);
AB>         Header("Content-type: image/jpeg");
AB>         ImageString ($image, 5, 12, 2, $code, $text_color);
AB>         ImageJPEG($image, '', 75);
AB>         ImageDestroy($image);

AB> Most people get a nice image but some people get only, what appears to 
AB> be, garbage:

AB> ÿØÿàJFIFÿþ;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), 
AB> quality = 75 ÿÛC    $.' 
AB> ",#(7),01444'9=82<.342ÿÛC  
AB> 2!!22222222222222222222222222222222222222222222222222ÿÀ
AB> ...snip...

AB> For the complete output have a look here:
AB> http://www.samuel-area.de/phpbook/confirm_image.php

AB> Do you know what is going wrong here?

AB> Yours,

AB> Age


Make sure you don't have any blank lines before the <?php

-- 
regards,
Tom

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to