Jump to content

Recommended Posts

Hi!

 

I can't use cronjobs on my server so I decided that my update script could be run by my sites visitors.

 

Now I am trying to figure out how.

 

Idea was to get system time every time the visitor opens the page and If more than 24 hours are passed then run script.

 

The update script would save time when it has run on text file.

 

I am php newbie so I need some help here.

I am also looking at the php time functions now to figure out how to do it.

Link to comment
https://forums.phpfreaks.com/topic/121098-run-update-script-every-24-hours/
Share on other sites

I took a look at php tuts

 

Here is what I can think of :

 


  If (date("z") > file_get_contents ('updatetime.txt')) 
  {
    Update;
    $fp = fopen('updatetime.txt', 'w');
    fwrite($fp, date("z"));
    fclose($fp);
  }

 

Do you have a better idea ?

it a wast off time you got to run a cron job...............

 

relying on user being on the web site to update a database or flat file is stupid

and not the correct way to do computer programming.................................

 

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.