Problems creating images

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

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

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

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

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

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

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

Do you know what is going wrong here?

Yours,

Age

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux