Click to See Complete Forum and Search --> : I Need A Script!!!
RScop09
12-06-2003, 09:25 PM
I NEED A SCRIPT...
I need a script that will time the users. I want to set a time limit of about 5 minutes and after 5 minutes i want it to redirect the user to another page! If someone can give me one or tell me how to make it i would be delighted to have you on my website staff if you would like! Plz i need help!!!!
:confused:
simpson97
12-07-2003, 02:17 AM
Heres a quickie:
<html>
<script language='javascript'>
timeLimit = 5;
now = new Date();
min = now.getMinutes();
quitTime = min + timeLimit;
setInterval("checkTime()", 1000);
function checkTime() {
now = new Date();
min = now.getMinutes();
if(min > quitTime) {
window.location = 'redirectPage.html';
}
}
</script>
<body>
</body>
</html>
I didnt account for minutes after 55, shouldnt be a problem.
email: simpson_97@yahoo.com
Bob
simpson97
12-07-2003, 02:40 AM
Its late so disregard last thread I posted - brain went to sleep for a minute:
This should do it.
<html>
<script>
now = new Date();
startSeconds = now.getTime();
timeLimit = 60000 * 1; // 1 minute set to your # of minutes
quitTime = startSeconds + timeLimit;
setInterval("checkTime()", 1000);
function checkTime() {
now = new Date();
min = now.getTime();
if(min > quitTime) {
window.location = 'redirectPage.html';
}
}
</script>
<body>
</body>
Bob
</html>