Possible Duplicate:
pass crontab a variable and read it from PHP?
Quick question: is there a way to cron job a single command line in a php script rather than execute the whole script? I’d like to only execute a specific “submit” command from the part of the script that handles the UI.
This would essentially mimic the clicking of the correlating button on a web page.
I’ll be using cpanel to execute it.
One option would be to pass some
$_GETparameters to the command that executes the cron job. If your command is –The you’d be able to add something like this –
Then in your
cron_job.phpfile, you can execute a switch command on youractionparameter.It would be fitting to mention here the importance of sanitization. You are receiving parameters that could potentially be tampered with by the users. Make sure that you only accept your defined actions and that you are indeed receiving expected inputs.