Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check the file execution

Status
Not open for further replies.

spookie

Programmer
May 30, 2001
655
IN
What i want is to make sure a certain php file gets executed ONLY once in a day with the loading of a certain web page.(an alternative to cron)
so in that page i need to check if that php file has been executed in last 24hrs and if not execute the file.
how can i achieve this?

spookie --------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
create a text file that would store the timestamp of the last execution of you php script and before executing the script check that timestamp - if < 24 hours then exit else update the timestamp and execute script
 
you can serialize a variable wich contains the timestamps too (it's nearly the same but you always work with the same variable :c\
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top