tiota Posted July 29, 2010 Share Posted July 29, 2010 Hi, I've been wondering if it is possible to load a php page according to certain time. For example at 12:00 pm a php form will pop up automatically informing an employee to fill in something in the form, another form will pop up at 4:00 pm, etc... Thanks in advance Link to comment https://forums.phpfreaks.com/topic/209185-load-php-page-automatically/ Share on other sites More sharing options...
inversesoft123 Posted July 29, 2010 Share Posted July 29, 2010 It can be done with cron jobs. Run a specific script at specific time from cron job and trigger a flag in database. Like PAGE: cronjob.php @ 4.00 pm mysql_query("UPDATE pf_events SET notify='1'"); PAGE : index.php Select flag from database. $selectflag = "SELECT * FROM pf_events'"; $selectflag2=mysql_query($selectflag); $selectflag3=mysql_fetch_array($selectflag2); if($selectflag3[notify] == "1") { // paste your popup code here } } Also, you can create another cron job script and run it on 4:05 PM daily to set notify flag again to 0 Link to comment https://forums.phpfreaks.com/topic/209185-load-php-page-automatically/#findComment-1092446 Share on other sites More sharing options...
JasonLewis Posted July 29, 2010 Share Posted July 29, 2010 If you want it to popup automatically however you'd need to use JavaScript and AJAX, because the script would now be acting client-side. Link to comment https://forums.phpfreaks.com/topic/209185-load-php-page-automatically/#findComment-1092450 Share on other sites More sharing options...
litebearer Posted July 29, 2010 Share Posted July 29, 2010 Another scenario, by using windows scheduler you can ... 1. php script is on website 2. employee does not currently have browser open 3. at appointed time, scheduler starts browser pointed to website script 4. employee performs task Link to comment https://forums.phpfreaks.com/topic/209185-load-php-page-automatically/#findComment-1092529 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.