Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch file to run a php script

Status
Not open for further replies.

Brianfree

Programmer
Feb 6, 2008
220
GB
Hi please can anyone assist me with creating a windows batch file which calls a php page. The php page will then do what it needs to and wright the results to a text file.

Hope this helps,

many thanks,

brian
 
You mean:

Code:
>\path\to\php\php.exe nameofpage.php

This will run the PHP file through the Php interpreter and execute the commands. It will output any...well... output back into the console, but will not open an Page in a browser.





----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
HI, thanks for the response - this is what i am hoping, do you think that i could create a text file from running a php file???

Many thanks,

Brian
 
Sure... use fopen, and fwrite or file_put_contents() to write the file.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top