在我的网站上进行在线考试的行为[关闭]

I want to add a page in my website by which I want conduct online exams. I want that my page is activate for 3 hours only. After 3 hours the page will submit itself as happens in online exams. Can any one give me any script how to make my page time constraint?

$time = date('Y-m-d H:i:s');

extract the hour from the date and do this

if ($hour > 10800){ // 10800 which is equal to 3 hours in seconds.

    submit the exam

}

don't rely on javascript to set the time because the javascript may be disabled.