help php timer

Started on the old forum in December 2011 · view the original in the archive · old links redirect here

5 replies · 653 views · started 14 years ago · 1 min read

4 participants
Sifat3d Developer · 66 posts #1

I just want to make a PHP script that will act normal when visited,and $do_secret_thing="no"; but ONCE every six hours when visited it will set: $do_secret_thing="yes"; this Needs to happen ONCE every SIX HOURS. Anyone please give me sample php code. I will be gratefull. Thanks in advance.:-)

Fake hack any website,even coding-talk for some clean FUN!!! Try: fake hacking website Mig33 Software for pc: Mig33 for PC mobile games and software download

Rksk Developer · 54 posts #4

You can store last Explose in a mysql record or just in a file. when a vistor visits ur site, it has to check time defferent between now n last Explose time. then if it more than 6h, just Explose it again n save last Explose time.

*Explose=ur secret thing 🙂

just_m3. Developer · 199 posts #5

you can do that with server crono job set it to your file accesing it once every 6 h .. 😛

This is ten percent luck, twenty percent skill Fifteen percent concentrated power of will Five percent pleasure, fifty percent pain 😂And a hundred percent reason to remember the name!

ionutvmi Junior · 45 posts #6

if you want a php code

<?php
$last=file_get_contents("time.txt");
if(time() > ($last + (6*60*60))) 
{
	file_put_contents("time.txt",time());
	echo "special thing";
} else {
echo "nothing";
}
?>

but i would go for a cron job

PIMP-WAP.NET - PIMP YOUR MOBILE

MASTER-LAND.NET - WAPMASTERS LAND

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close