file exist

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

superman
New php-forum User
New php-forum User
Posts: 36
Joined: Fri Jun 27, 2003 11:54 pm

file exist

Postby superman » Mon Aug 25, 2003 11:05 pm

can PHP perform the task that run the page only once a year, something like check the file has run before, if yes, then show message that the page already run, if not, run the script.
thank you for help.

Joel
New php-forum User
New php-forum User
Posts: 193
Joined: Sat Mar 29, 2003 11:57 pm
Location: Auckland, New Zealand
Contact:

Postby Joel » Mon Aug 25, 2003 11:45 pm

You could do something like this

Check when last update was made
- When an update is made, write to a file with a unix timestamp

If last update was more than a year ago then update
- if (($LastUpdate + 1yearinseconds) <= time())

superman
New php-forum User
New php-forum User
Posts: 36
Joined: Fri Jun 27, 2003 11:54 pm

Postby superman » Tue Aug 26, 2003 12:57 am

i'm not familiar & understand with timestamp, how does it works? :wink:

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Postby Joan Garnet » Tue Aug 26, 2003 5:07 am

All related documentation is here:
http://es.php.net/manual/en/ref.datetime.php

Have a look, there are many good examples and explanations.


Return to “PHP coding => General”

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron