...

View Full Version : getting the time at which the user clicks on a hyperlink



sradha
03-14-2010, 07:39 PM
Hello Friends....Wat should I do inorder to get the time at which the clicks on an hyperlink.I'll tell u wat I actually needs...I am making an exam site.When user clicks on the link"Attend exam" the xam gets started.His start time gets added up to the total duration of xam.When the server time exceeds the time allowed for exam(i.e his start time+exam duration) the exam paper disappears.But I don't knw how can I get the time at which user clicks on the link "attend test".
The code that I tried is,


if(isset($_GET['scd']))
{
$ctime=date("H:i");
$inviselmt=$_GET['scd'];
$_SESSION['xmstart']=$ctime;
$st_time=$_SESSION['xmstart'];
echo $st_time;
}

here 'scd' is a variable that is passed when the user clicks on the link "attend test"..st_time denotes the start time.
With this code, even if I'm using the session whenever the page gets refreshed the time also changes .

abduraooft
03-14-2010, 07:53 PM
With this code, even if I'm using the session whenever the page gets refreshed the time also changes .
Something like
if(!isset($_SESSION['xmstart']) && isset($_GET['scd']))
{
$ctime=date("H:i");
$inviselmt=$_GET['scd'];
$_SESSION['xmstart']=$ctime;
//$st_time=$_SESSION['xmstart'];

}
if(isset($_SESSION['xmstart']))
echo $_SESSION['xmstart'];
?

sradha
03-14-2010, 09:07 PM
ya it's working...thanks alottttt..:)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum