Non-event-driven?

liunx

Guest
This may not be a PHP question, but it's something I've been stumped on for quite some time.<br /><br />I have PHP pages and MySQL databases. This all works great for me for almost everything. (I throw in some JavaScript if I need pop-up windows or dynamic stuff).<br /><br />Now, is there any way, with any of that set up how it is, to cause it to send me a "reminder"? I would love to set up some sort of reminder database - or, say, when I have a database of clients, and they need recurring billing, can I create a script to send me an email when it gets within a month of needing to ask them for the next year's payment?<br /><br />Would appreciate any conjecture, at this point. I have a few ideas, but there's got to be something simpler out there.<!--content-->
Hi,<br /><br />You need something to trigger / run a PHP script, so you can not do it as a "non-event-driven" command as far as I am aware.<br /><br />There are 2 other possible solutions.<br /><br />1. you create the script, and run it yourself on a regular basis, or attach it to a page / event that get's run at the right sort of frequency.<br /><br />2. you set up a Cron Job to run on a monthly basis, which executes your PHP script to check the database and send out an email.<br /><br />I'd go for option 2 myself <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> <br /><br />Andy<!--content-->
Cool, option 1 is definitely available to me.<br /><br />Do you know of any tutorials or sites on Cron Jobs? Even if I don't choose to do that, it would be good knowledge to have. And how to impliment them, I have no clue. *g*<!--content-->
I've personally never used cron jobs before (for lack of knowing how), but here are a couple of links I found. It looks like you have to know Linux server commands.<br /><br /><a href="http://dpg-law.com/solo/LAWebbie_201/C_Unix/1_Cron/cron6a.shtml" target="_blank">The first link is how to write them.</a> The page is weird... when you click on one of those links, it looks like the page just flickers. You have to scroll up to see the part of the page that changed.<br /><br /><a href="http://www.cpanel.net/docs/cp/cronJobs.htm" target="_blank">This link is simply how to use CronJobs in CPanel.</a><!--content-->
Lunar Magic, just create a simple PHP script that suits your needs and works as you want it to when you call it from a web browser. Then you just need to set up a cron job in Cpanel with the following command:<br /><br />php -q /path/to/your/script.php<br /><br />The timing stuff seems quite basic to me but if you have any doubts, post here and I'll give you a hand <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
 
Back
Top