IrOnMaSk Posted July 19, 2011 Share Posted July 19, 2011 hey guy, this is probably the dumbest question I ever ask. But can a php page be running in a batch mode, which means i want it to run in the background when i attemp to open it in a browser? So i'm using php mail function to send out email. to do so i have to open it up in a browsers, but it will be just empty page so i don't want it to pop up. So i wrote a batch file to call the page. @echo off start iexplore.exe http://localhost/licensedb/Dev/home.php ping 123.45.67.89 -n 1 -w 20000 > nul taskkill /im iexplore.exe start iexplore.exe http://localhost/licensedb/Dev/send_mail.php ping 123.45.67.89 -n 1 -w 10000 > nul taskkill /im iexplore.exe thats the batch file calling to the 2 pages. So is there a way to just run it in the background without having them popping up? thanks guys Quote Link to comment https://forums.phpfreaks.com/topic/242370-run-php-in-batch-mode/ Share on other sites More sharing options...
premiso Posted July 19, 2011 Share Posted July 19, 2011 Use the php CLI ? C:\path\to\php> php -f c:\path\to\phpfile.php Word of warning, you may need to modify the file to run under the CLI (IE if you use $_SERVER['HOST'] or DOCUMENT_ROOT), but most of the time it will work. Another option is to look for a lynx type browser or wget for windows. Quote Link to comment https://forums.phpfreaks.com/topic/242370-run-php-in-batch-mode/#findComment-1244847 Share on other sites More sharing options...
IrOnMaSk Posted July 19, 2011 Author Share Posted July 19, 2011 thanx for reply premiso... i think its too hard to have it run in a batch mode... anyway, the batch file works fine. Anyone knows anything about autosys? i'm using it to schedule to run the batch file; the job executes the batch but the commands in the batch are not executed which to open the two pages!!! but i think its the wrong place to ask here!!! don't know where to ask this complex question!!! :'( Quote Link to comment https://forums.phpfreaks.com/topic/242370-run-php-in-batch-mode/#findComment-1244913 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.