Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I need a valuable suggestion that I have to run the PHP script at the scheduled time daily to update some fields in database and to send automated email.

How I can do this? Is it possible to write some service in XAMP server? To run the script daily at scheduled time?

I have no idea how to update database and send email automatically at the scheduled time. Can any one share some ideas or concepts?

I am using PHP, MySQL, Linux.

share|improve this question

2 Answers 2

Easiest way is to set up a cronjob that triggers a php script in php-cli.

http://en.wikipedia.org/wiki/Cron

http://www.pantz.org/software/cron/croninfo.html

share|improve this answer

If you have dedicated or virtual hosting then you should be able to set up a cron job that calls PHP via command line. Actually the easiest way I've found is to use wget to fetch it as a web page, which helps if you are using frameworks or rewriting URLs instead of one single PHP file. Something like:

wget -o /dev/null "http://example.com/page"

You can use wget from any (Linux) computer anywhere. You can do similar from your own PC if you like using Scheduled Tasks.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.