Jump to content

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.

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.