puntapuisomos Posted December 8, 2007 Share Posted December 8, 2007 I am writing a script in which a test person has to remember a number, that gradually increases in the number of digits, if the tester has remembered the number well. In the <head> there is a redirect to another page after about 7 seconds, where the tester has to fill in the number he/she has just seen. This all works well. But if the answer is wrong, I would like the "redirect" of the page to be stopped. It would look like this: if ($answer<>$number) { echo ("Sorry, it was the wrong answer; you have managed to remember $series digits in one go."); //and here I want the switch out of this page, for within couple of seconds it will be redirected again!! } else { //here it continues to generate a new, longer, number. Quote Link to comment Share on other sites More sharing options...
Seraph Posted December 8, 2007 Share Posted December 8, 2007 look into javascript countdowns and redirections this has nothing to do with oop Quote Link to comment Share on other sites More sharing options...
xinteractx Posted December 18, 2007 Share Posted December 18, 2007 here a old script i wrote about year ago. <script language="JavaScript"> function SESSION_TIMEOUT() { var t=setTimeout("KICK()",32400000); } function KICK() { window.location = "index.php"; } </script> 32400000 is milliseconds i think.. i also used my own custom session control and a time stamp the sessions inside my database. if they where not stamped within the time period the session would be removed from the db and then they javascript would fire locally to make sure they know they been kicked. I stamped the session each time they browsed to another page and used this script of more of a inactivity kick script to kick the users off if they left there pc running all day and forgot about it and went home. Quote Link to comment Share on other sites More sharing options...
teng84 Posted December 19, 2007 Share Posted December 19, 2007 this is not OOP this is more of javascript or maybe plain php! and what is your question ? Quote Link to comment 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.