Jump to content

scheduled chunks of code


edawg

Recommended Posts

One way would be:

 

if(date("l") == "Monday) {
//do stuff
}

 

That's where you're wrong :)

 

if(date("l") == "Monday"){
//do stuff
}

 

I just had to.

 

The trouble with that is the page needs to be accessed, if you want it to be independent of that, use a cron job. 

You set a cronjob by using a broswer like "wget or lynx" to open your page "http:www.example.com".

30 * * * 0 * wget -q http://www.example.com/script.php

this will run your script every sunday at 12:30am.

Check out this site to learn more about cron http://www.unixgeeks.org/security/newbie/unix/cron-1.html.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.