Go Back   Dreamweaver Club Forums > Hand Coders Forum > General
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 09-21-2007, 12:59 AM   #1
Join Date: Apr 2006
Posts: 290
Default anybody know tuts on php cron job script writing?

Hi instead of me writing individual reminders emails to expired listings on my directory I am wanting to set up a cron to do this for me automatically.
My host said to let them know of what cronjob they want me to run and at what frequency. Now this is where I need to learn - the scripting part and what are the consequences of doing this.
nanny is offline   Reply With Quote
Old 09-21-2007, 05:22 AM   #2
davidj's Avatar
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256

all you do is write your PHP script as normal with a .php extension

dont add any output like HTML or echos

tell your host the script to run and at what time you want it to run and thats it.

make sure you test it first
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 09-21-2007, 06:03 AM   #3
Join Date: Apr 2006
Posts: 290

Thanks - so to have the database input I should do something like:
Connect to database with
PHP Code:
so long as it is in the same directory
Then do a sql query to find the email addresses of the listings that the expiry date is .....how do I check for past the current date or leading up to the current date?
Then set up the email address etc.
The other question do I use explode for the email addresses as an array and use the delimiter ,
Then do I exit or does it do it automatically from the database?
Sorry for all the questions I am trying to piece it all together so that I can change it for other purposes later.
nanny is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 03:39 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com