Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

file exist

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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.
superman
New php-forum User
New php-forum User
 
Posts: 36
Joined: Fri Jun 27, 2003 11:54 pm

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())
Joel
New php-forum User
New php-forum User
 
Posts: 193
Joined: Sat Mar 29, 2003 11:57 pm
Location: Auckland, New Zealand

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

i'm not familiar & understand with timestamp, how does it works? :wink:
superman
New php-forum User
New php-forum User
 
Posts: 36
Joined: Fri Jun 27, 2003 11:54 pm

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.
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron