RE: [PHP] My own "captcha" from 2 years ago......

From: Date: Mon, 26 Mar 2007 12:49:13 +0000
Subject: RE: [PHP] My own "captcha" from 2 years ago......
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-251363@lists.php.net to get a copy of this message
At 10:02 PM -0400 3/25/07, Jake McHenry wrote:
Like I said... Even if they have sound turned on.. Which all my sets do... Most of them don't have speakers... That was put into effect over a year ago due to some people listening to those damn screaming prank things at full volume... Anyways... I was searching the php site, and it said there used to be a bug that looks somewhat similar to my problem, but it said it was fixed long ago... Not sure if this is even close to it or not, but this is the first time I've run into a sessions problem..... Just to simplify... I have this on index.php <?php session_start(); $before = $_SESSION['code']; echo '<img src=image.php>'; $after = $_SESSION['code']; echo $before .' ' . $after; ?> Then in image.php is my captcha... And where the session variable 'code' is being created and updated... In image.php is this: <?php session_start(); ..........captcha code...... $_SESSION['code'] = rand(blahblahblah) to get the random code ?> When I view index.php, the image displays, with a new code each time... Working as it should, but the session variable echos out the previously generated value, instead of the current value to match whats in the picture... I'm not sure what I've done... But you can see from
http://nittanytravel.com:8080/    $before and $after have the same value...
In that bug report I was reading it said that this happened until session_start was called again.. But it said it was fixed back in php4... Not sure what I missed :( Thanks, Jake
Jake: Clearly, your image.php is not changing the code (key). Your "blahblahblah" has to be less than 32768 if you're running windows -- maybe that's the problem. But, I would look to my rand() for an answer. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#251363) next »