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

From: Date: Thu, 19 May 2005 21:41:48 +0000
Subject: Re: Image Verification - Problems in Safari, Mac OS X
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-215626@lists.php.net to get a copy of this message
Rahul S. Johari wrote:
On 5/18/05 6:23 PM, "Marek Kilimajer" <lists@kilimajer.net> wrote:
BTW, you might not be concerned about it much, but you have a race condition in your script.
Ave, What do you mean by "race condition" ?
If more then one user is accesing the page, you might overwrite the first one's verify.png image. Simple and sufficient solution is to append a random string to the filename: $image_filename= 'verify_' . md5(rand()) . '.png'; ImagePNG($im, $image_filename); ?> <img src="<?php echo $image_filename; ?>" width="200" height="40"> <?php Just remember to add some way to remove old images.

« previous php.general (#215626) next »