Hello, If its been over 1 hour since the time stamp was created I want to echo 'Error' but if its under 1 hour since the time stamp was created I want it to echo 'Okay' the only bit of code I have is $now = time(); $timestamp = $row['timestamp']; PHP: Thanks.
I image your idea is when user login, system recorded time stamp is T1 and if user online over 1 hour will get message "Time out". It's right? Where and how did you store time stamp? I try: $past = time(); // Record it to Database or use cookie/session Make a js script (setTimeout() function) to check active $now = time() for each 10s (maybe more if you like) if ($now - $past < 3600) { echo "Okay"; } else { echo "Error"; } Code (markup):