Hi guys... ahm im new in php.
i really need help with this..
i am making a exam system.
i want to put a time limit to my exam page like 20mins
and when the user still dont click the next button and the limit reach.
it will automatically refresh the page aand redirect to next page..
hope some1 will help me on this..
any help would b appreciated.

Here i have posted code which will work for 5second, you can set urs.

<html>
<head>
<script type="text/javascript">
function timedMsg()
{
var t=setTimeout("redirect()",5000);
}
function redirect()
{
	alert('5 seconds is completed!');
	window.location.href='nextpage.php';
}
</script>
</head>

<body onload="timedMsg()">
exam paper.
</body>
</html>

thnx for it.. it really help alot and it work good.
but i need it to auto send..because im making an online exam.

another logic:
1- make a one iframe in main page.
2- on header of main page put a timer of 20 minute.
3- When 20 min finishes close iframe using js and prompt user that time is over.

Check this steps might be help u.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.