Time-In and time_out Script using php and mysql
Posted: Fri Sep 10, 2010 2:06 am
Can anyone give me an idea on how to create a time-In and time-Out using php and mysql or can anyone give me an idea.
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$last_page_action_timestamp = $_SESSION['timestamp'];
$expiry_time = 2*60; // 2 minutes
echo 'Last timestamp was: ' . $last_page_action_timestamp . '<br />';
echo 'Current timestamp is: ' . mktime() . '<br />';
echo 'Expiry time set to ' . ($expiry_time / 60) . ' minutes<br />';
if (mktime() > ($last_page_action_timestamp + $expiry_time)) {
echo 'Timestamp has expired<br />';
} else {
echo 'Timestamp is still valid<br />';
}