Jump to content

[SOLVED] How to do things in the background...


apsac

Recommended Posts

Hi all,

 

I am looking for a way for my site to do something in the background.  I'm a relative beginner so bare with me...

 

My site has a DB which stores stocks and their prices.  This is updated every time the user logs in to find them the latest price.  However, I want to add a function so that the user can say "If the stock reaches this price, do this (probably send an email or something)".  I know of the mail() function so sending an email isn't a problem but since my DB is only updated when someone logs in, I'm struggling to get my head round how to do something when someone isn't loading the page.  For example, someone might not log in for 2 weeks but in that 2 weeks I want the price to be checked to see if something should be done.

 

It might not even be a PHP solution but was wondering if anyone had a good direction to head in.

 

Thanks in advance

If you're in school, they may only allow root to edit the crontab but you can still try

 

follow the tutorial, you go into the console and type in "crontab -e" to edit the cron tab.

 

 

Then you have to read the tutorial for the time format, and you just give it the path for the script you want to run.

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.