php cron job with url parameters
Hi There,
I have read through the forum and have not been able to see this problem described anywhere.
I am trying to execute a php scrip through cron and can successfully do so with the following line:
php /home/MyPath/public_html/cron.php
The problem is that I need to append some parameters to the php scrip like this:
php /home/MyPath/public_html/cron.php?paremeter1=value1&patermeter2=value2
This does not work. I think the error was "File not found". Which is sort of obvious in retrospect since it is a file path based execution.
I then changed the cron to execute a different php file:
php /home/MyPath/public_html/cron_redirect.php
In this file I have the following code:
This does not work. I get an email from cron saying:
Status: 302
X-Powered-By: PHP/4.4.1
Location: http://www.mysite.com/cron.php?paremeter1=value1&patermeter2=value2
Content-type: text/html
But my file is not redirected.
Can someone help me please?
Thanks a bunch!
Hi There,
I have read through the forum and have not been able to see this problem described anywhere.
I am trying to execute a php scrip through cron and can successfully do so with the following line:
php /home/MyPath/public_html/cron.php
The problem is that I need to append some parameters to the php scrip like this:
php /home/MyPath/public_html/cron.php?paremeter1=value1&patermeter2=value2
This does not work. I think the error was "File not found". Which is sort of obvious in retrospect since it is a file path based execution.
I then changed the cron to execute a different php file:
php /home/MyPath/public_html/cron_redirect.php
In this file I have the following code:
Code:
<?php
header("Location: http://www.mysite.com/cron.php?paremeter1=value1&patermeter2=value2");
?>
Status: 302
X-Powered-By: PHP/4.4.1
Location: http://www.mysite.com/cron.php?paremeter1=value1&patermeter2=value2
Content-type: text/html
But my file is not redirected.
Can someone help me please?
Thanks a bunch!