Jump to content

time out in a web page


streetfi8er

Recommended Posts

you could use sessions.

 

$_SESSION['startime'] = microtime(TRUE);

 

then when the user goes to submit the test, just do a check like this:

 

$maxTime = 10800; // 3 hours (time in seconds)
if((microtime(TRUE) - $_SESSION['startime']) > $maxTime){
   echo 'You took too long';
}else{
   echo 'Thank You! You are done!';
}

save a time stamp in the database, use ajax to keep refreshing the page,

 

if the time == 3hrs then submit current information and send them to a warning page,

but let them see there  current results.

 

could be also doNE in php where they can not enter no more information in the database when the time has reached 3 hours.

 

 

WHALE LITTLE GUY EXAMPLE IS GRATE AND SO EASY!

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.