abs0lut Posted August 22, 2008 Share Posted August 22, 2008 I know how to select the members who did not post for every topic. I need to send an email every 24 hours to the members who did not post for every topic. Could you please help me? Quote Link to comment https://forums.phpfreaks.com/topic/120787-send-email-every-24-hours-for-every-topic-without-using-cron/ Share on other sites More sharing options...
trq Posted August 22, 2008 Share Posted August 22, 2008 Without a scheduler (cron) its going to be quite difficult. Quote Link to comment https://forums.phpfreaks.com/topic/120787-send-email-every-24-hours-for-every-topic-without-using-cron/#findComment-622610 Share on other sites More sharing options...
DeanWhitehouse Posted August 22, 2008 Share Posted August 22, 2008 Unless you want to ccess the page every 24 hours and send it. Quote Link to comment https://forums.phpfreaks.com/topic/120787-send-email-every-24-hours-for-every-topic-without-using-cron/#findComment-622612 Share on other sites More sharing options...
abs0lut Posted August 22, 2008 Author Share Posted August 22, 2008 so, please help me on how to use cron in cpanel. What will I enter in the command field if the path of the script has query string? http://domain.com/sendemail.php?topicid=1 http://domain.com/sendemail.php?topicid=2 ... for every topic, I want to send an email to the members who did not post Quote Link to comment https://forums.phpfreaks.com/topic/120787-send-email-every-24-hours-for-every-topic-without-using-cron/#findComment-622621 Share on other sites More sharing options...
ohdang888 Posted August 22, 2008 Share Posted August 22, 2008 create one file that goes through all the topics. it will be a LOT easier that way Quote Link to comment https://forums.phpfreaks.com/topic/120787-send-email-every-24-hours-for-every-topic-without-using-cron/#findComment-622623 Share on other sites More sharing options...
abs0lut Posted August 22, 2008 Author Share Posted August 22, 2008 create one file that goes through all the topics. it will be a LOT easier that way Did you mean I will include that one file, then if someone visits that topic, the email will be sent. Then what if no one viewed any topics? Quote Link to comment https://forums.phpfreaks.com/topic/120787-send-email-every-24-hours-for-every-topic-without-using-cron/#findComment-622649 Share on other sites More sharing options...
ohdang888 Posted August 22, 2008 Share Posted August 22, 2008 no... activitate with a cron_job the file of "send.php"; and in that send.php, it will go through all the topics automatically, rather than a individual file for each topic Quote Link to comment https://forums.phpfreaks.com/topic/120787-send-email-every-24-hours-for-every-topic-without-using-cron/#findComment-623294 Share on other sites More sharing options...
abs0lut Posted August 24, 2008 Author Share Posted August 24, 2008 I have set up a cron task using the cron jobs application in cPanel, I indicated that everyday it should run the following task http://domain.com/send.php and I received this email /bin/sh: http://domain.com/send.php: No such file or directory could you please help me? Quote Link to comment https://forums.phpfreaks.com/topic/120787-send-email-every-24-hours-for-every-topic-without-using-cron/#findComment-623987 Share on other sites More sharing options...
Stephen Posted August 24, 2008 Share Posted August 24, 2008 If you don't like cron you could try this: ignore_user_abort(true); set_time_limit(0); do { //Code here sleep(86400); //24 hrs } while (true); Not tested. I'm sure cron would be much more efficient though, of course I have no experience with it though. Quote Link to comment https://forums.phpfreaks.com/topic/120787-send-email-every-24-hours-for-every-topic-without-using-cron/#findComment-624005 Share on other sites More sharing options...
DeanWhitehouse Posted August 24, 2008 Share Posted August 24, 2008 That wont work, maximum exectution time is 30 seconds Quote Link to comment https://forums.phpfreaks.com/topic/120787-send-email-every-24-hours-for-every-topic-without-using-cron/#findComment-624012 Share on other sites More sharing options...
Stephen Posted August 24, 2008 Share Posted August 24, 2008 That's why you do: set_time_limit(0); Quote Link to comment https://forums.phpfreaks.com/topic/120787-send-email-every-24-hours-for-every-topic-without-using-cron/#findComment-624032 Share on other sites More sharing options...
DeanWhitehouse Posted August 24, 2008 Share Posted August 24, 2008 One not all hosts allow that , and two he would have to have the script running all the time Quote Link to comment https://forums.phpfreaks.com/topic/120787-send-email-every-24-hours-for-every-topic-without-using-cron/#findComment-624040 Share on other sites More sharing options...
DarkWater Posted August 24, 2008 Share Posted August 24, 2008 I have set up a cron task using the cron jobs application in cPanel, I indicated that everyday it should run the following task http://domain.com/send.php and I received this email /bin/sh: http://domain.com/send.php: No such file or directory could you please help me? You need to actually run the script through the PHP binary. The shell has no idea how to parse it. And you don't use the URL of the file, you use the file path. You'd probably use: 0 0 * * * /usr/bin/php /home/yourname/send.php Quote Link to comment https://forums.phpfreaks.com/topic/120787-send-email-every-24-hours-for-every-topic-without-using-cron/#findComment-624052 Share on other sites More sharing options...
Stephen Posted August 24, 2008 Share Posted August 24, 2008 One not all hosts allow that Well would be good to get have one that does and two he would have to have the script running all the time When you use ignore_user_abort, it will still run even if the user closes out of the page (I believe). Also using sleep will have it rest for 24 hours to do it again. Cron would be better to do though. Quote Link to comment https://forums.phpfreaks.com/topic/120787-send-email-every-24-hours-for-every-topic-without-using-cron/#findComment-624095 Share on other sites More sharing options...
tibberous Posted August 24, 2008 Share Posted August 24, 2008 Stephen's right, you can get a script to run 24/7, I made an uploader one time that ran 23.5 hours a day, and only restarted itself with cron to release it's memory and fix if it crashed - and it never crashed. All cron is is a program that runs all the time, there isn't much difference between it and having PHP do it. I would start it with putty and background the process though - we have to do some weird stuff to keep it from dieing when the session was closed. Quote Link to comment https://forums.phpfreaks.com/topic/120787-send-email-every-24-hours-for-every-topic-without-using-cron/#findComment-624116 Share on other sites More sharing options...
abs0lut Posted August 24, 2008 Author Share Posted August 24, 2008 thanks Stephen, hope it will work. Quote Link to comment https://forums.phpfreaks.com/topic/120787-send-email-every-24-hours-for-every-topic-without-using-cron/#findComment-624205 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.