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
https://forums.phpfreaks.com/topic/80753-change-to-new-page/
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
https://forums.phpfreaks.com/topic/80753-change-to-new-page/#findComment-417734
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.