Jump to content

change to new page


puntapuisomos

Recommended Posts

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.

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.