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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change current PHP page that uses POST to a timed script

Status
Not open for further replies.
May 13, 2005
56
US
I have a page that I currently enter a name into a text box and hit submit to POST that data to another PHP page which then uses this name to run a couple of functions and make changes to a mySQL db.

What I am looking to do is either;
A. Turn the 2nd page into an executable that instead of receiving the data from a POSTed variable, opens a txt file and reads the different variables, running each with this script. (I would set this to run as a cron job)

B. Set the script to wait for an input (IE. script.php runthis) and then run it with individual names with a cron job for each..

Problem is, I dont know how to accomplish either. I am using a linux box with a BASH shell, PHP and MySQL along with other options if necessary..

Thanks,

Mike
 
You can run a php script as an executable by calling "php -q scriptname.php". You can make it executable by putting "#!/path/to/php -q" as the first line, but that messes it up for web use. The "-q" just suppresses HTML headers, so you might not need it.

 
Thanks for your reply, but, how would I make this script accept either a variable after the script name, or open a file and read the seperate names in and execute the script?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top