ibechane Posted August 24, 2008 Share Posted August 24, 2008 Sorry if this is in the wrong forum. I'm not sure which one is best. I was wondering, what is the most common way for people to program in local event handlers? For example, say I want to change an XML file on my server at exactly 11:56pm tonight. I assume that I would write some kind of program on my computer and have it loop, waiting do something to the file at the right time (or local event). Is there a common programming language or method to achieve this sort of thing? I don't want the action to rely on a client event (e.g. loading a php file). Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/121109-solved-server-side-event-handling/ Share on other sites More sharing options...
trq Posted August 24, 2008 Share Posted August 24, 2008 The most common way would be to have cron (a schedular for Linux) execute your script at a specific time. Quote Link to comment https://forums.phpfreaks.com/topic/121109-solved-server-side-event-handling/#findComment-624348 Share on other sites More sharing options...
ibechane Posted August 24, 2008 Author Share Posted August 24, 2008 thanks! I'm actually on Windows running WAMP right now on my laptop but I never thought to use the built in scheduler.. duh So right now, I have a PHP script that does stuff to files on my server, mostly writing to files. I want to run this script via a scheduler but not have to open a browser every time. There is very little response text. Maybe an "I'm done" or error message. Is there a way I can call a php file, like localhost/myscript.php, via the command line and just have it output the response text without having to open up a browser window? Or should I just try to convert my program to perl (I'm an extreme newbie w/perl so I'm not even sure how practical that is)? Thanks for your help thorpe Quote Link to comment https://forums.phpfreaks.com/topic/121109-solved-server-side-event-handling/#findComment-624382 Share on other sites More sharing options...
ober Posted August 24, 2008 Share Posted August 24, 2008 You can use Windows Task Scheduler. Just call the PHP Executable file as your command with your script as an argument. Your script can do whatever you want, including calling other files. Quote Link to comment https://forums.phpfreaks.com/topic/121109-solved-server-side-event-handling/#findComment-624394 Share on other sites More sharing options...
ibechane Posted August 24, 2008 Author Share Posted August 24, 2008 Thanks. I actually just thought to try it before I read this post. Thanks for you help guys. Quote Link to comment https://forums.phpfreaks.com/topic/121109-solved-server-side-event-handling/#findComment-624396 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.