Re: Image Verification - Problems in Safari, Mac OS X

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

 



Your image is *NOT* a DOCTYPE HTML PUBLIC blah blah!!!

It's a *IMAGE*

Get rid of all the HMTL stuff.

You actually need to separate this into two different files.

One has all the HTML in it, with a SRC=/URL/to/image.php/image.png

The other is JUST the image stuff.

If IE actually displays it as-is, that's pretty broken...  But IE is
pretty broken as it is, so one more broken-ness shouldn't surprise
anybody.


On Wed, May 18, 2005 12:51 pm, Rahul S. Johari said:
> Ave,
>
> A simple Image Verification script is working perfect in IE on Windows...
> But isn¹t working in Safari on Mac OS X! It displays a blank page instead
> of
> the image with the form. Here¹ s the Script:
>
> <?
> header("Content-Type: image/png");
> session_start();
> $new_string;
> session_register('new_string');
> ?>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd";>
> <HTML>
> <HEAD>
> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <TITLE>Verification : IMSAFM</TITLE>
> </HEAD>
> <BODY>
> <?php
> $im = ImageCreate(200, 40);
>
> $white = ImageColorAllocate($im, 255, 255, 255);
> $black = ImageColorAllocate($im, 0, 0, 0);
>
> srand((double)microtime()*1000000);
> $string = md5(rand(0,9999));
> $new_string = substr($string, 17, 5);
> ImageFill($im, 0, 0, $black);
> ImageString($im, 4, 96, 19, $new_string, $white);
> ImagePNG($im, "verify.png");
> ImageDestroy($im);
> ?>
>
> <img src="verify.png" width="200" height="40"><br><br>
> Type the code you see in the image in the box below. (case sensitive)
> <form action="verified.php" method=post>
> <input name="random" type="text" value="">
> <input type="submit">
> </form>
> </BODY>
> </HTML>
>
> Any tips to make it work in Safari as well?
>
> Thanks,
>
> Rahul S. Johari
> Coordinator, Internet & Administration
> Informed Marketing Services Inc.
> 251 River Street
> Troy, NY 12180
>
> Tel: (518) 266-0909 x154
> Fax: (518) 266-0909
> Email: rahul@xxxxxxxxxxxxxxxxxxxx
> http://www.informed-sources.com
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
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