| | |
Problems with cron file
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jun 2009
Posts: 9
Reputation:
Solved Threads: 0
Hi,
I have a corn.php file that runs automatically every day and one of the functions is to send an e-mail to certain users.
The problem is that the e-mails are being sent twice. I can't find anything wrong with the cron file, but checking the access_log.processed file of the server I found two entries with the cron file runnig at practically the same time:
1)..."HEAD /x/cron.php..."
2)..."GET /x/cron.php..."
I don't know much about apache but I think the problem might be that the HEAD method is also sending e-mails when it runs the file, so my questin is: ¿Can the HEAD method run the php file to send emails?
Thank you
I have a corn.php file that runs automatically every day and one of the functions is to send an e-mail to certain users.
The problem is that the e-mails are being sent twice. I can't find anything wrong with the cron file, but checking the access_log.processed file of the server I found two entries with the cron file runnig at practically the same time:
1)..."HEAD /x/cron.php..."
2)..."GET /x/cron.php..."
I don't know much about apache but I think the problem might be that the HEAD method is also sending e-mails when it runs the file, so my questin is: ¿Can the HEAD method run the php file to send emails?
Thank you
Where do you get the e-mails from? Mysql?
If yes, then i would suggest:
add a "lastsent" field, and each time you send a e-mail, update that field with a time().
So before you sent emails build a if($lastsent > something) {
do_send();
} else {
walk_away();
}
I don't know if I got you right, but i hope you got me!
If yes, then i would suggest:
add a "lastsent" field, and each time you send a e-mail, update that field with a time().
So before you sent emails build a if($lastsent > something) {
do_send();
} else {
walk_away();
}
I don't know if I got you right, but i hope you got me!
![]() |
Similar Threads
- Rundll32 file problems? (Viruses, Spyware and other Nasties)
- File Size Problems (PHP)
- RS232 File Transfer Problems (Community Introductions)
- RS232 File Transfer Problems (VB.NET)
- Trojan Problems HJT File Included, Help Please (Viruses, Spyware and other Nasties)
- Query regarding Cron processes (*nix Software)
- fstream problems. No output to file. (C++)
- input from file into class (C++)
- Header File (C++)
Other Threads in the PHP Forum
- Previous Thread: I need a little tweek to a page nav code
- Next Thread: i want the best php class to work with mysql
| Thread Tools | Search this Thread |






