MadTechie Posted April 10, 2009 Share Posted April 10, 2009 I'm using WAMPserver2 on Windows XP SP3 i tweaked the code due to the time() being in a script and added isset for the sessions, however i have not had a page expire yet! My form2.php code <?php session_start(); if(isset($_POST['submit']) && isset($_SESSION['security_code']) && $_SESSION['security_code'] == $_POST['security_code']) { echo 'Thank you. Your message said "'.$_POST['message'].'"'; unset($_SESSION['security_code']); }else{ if(isset($_POST['security_code']) && isset($_SESSION['security_code']) && $_SESSION['security_code'] != $_POST['security_code']) { echo 'Sorry, you have provided an invalid security code'; } echo ' <form action="form2.php" method="post"> <label for="name">Name: </label><input type="text" name="name" id="name" /><br /> <label for="email">Email: </label><input type="text" name="email" id="email" /><br /> <label for="message">Message: </label><textarea rows="5" cols="30" name="message" id="message"></textarea><br /> <img src="captcha.php?width=100&height=40&characters=5&'.time().'" /><br /> <label for="security_code">Security Code: </label><input id="security_code" name="security_code" type="text" /><br /> <input type="submit" name="submit" value="Submit" /> </form> '; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/153398-need-a-very-simple-captcha-tool/page/2/#findComment-806475 Share on other sites More sharing options...
Omzy Posted April 10, 2009 Author Share Posted April 10, 2009 I've got a manual set up on my Windows Vista machine, consisting of Apache 2.2, PHP5 and MySQL 5 Did you definitely try the test by entering an incorrect code? I.e. steps to reproduce: 1) Enter incorrect code 2) Form should re-display, enter the correct code 3) Confirmation message displayed 4) Hit the back button and page has expired I don't suppose it could any setting in the php.ini or httpd.conf file? EDIT: Same result also in Windows XP SP3 / IE7 Quote Link to comment https://forums.phpfreaks.com/topic/153398-need-a-very-simple-captcha-tool/page/2/#findComment-806569 Share on other sites More sharing options...
Omzy Posted April 10, 2009 Author Share Posted April 10, 2009 Just tested on my friend's live server, same result there also. If you can, try uploading to a live server and test there? Quote Link to comment https://forums.phpfreaks.com/topic/153398-need-a-very-simple-captcha-tool/page/2/#findComment-806720 Share on other sites More sharing options...
Omzy Posted January 2, 2012 Author Share Posted January 2, 2012 I fixed this using: session_cache_limiter('private_no_expire, must-revalidate'); Quote Link to comment https://forums.phpfreaks.com/topic/153398-need-a-very-simple-captcha-tool/page/2/#findComment-1303316 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.