Hi all, I'm trying to get a cron job to run a PHP script (the easy bit) that will send a header redirect to another script on another server. The script needs to redirect to header("Location:http://www.domain.com?info=xyz&info2=abc"); where domain.com is not located on my server. It works if I run the script through the browser, but Cron doesn't seem to make it all happen. Is there any way to be able to do this? Thanks.
Have you tried wget? wget http://LOCALDOMAINNAME.COM/LOCAL.php or even bypass the middidle man: wget http://www.domain.com?info=xyz&info2=abc -Jason
Definitely cron and wget, and do it to the final page if possible. Also, you can get both cron and wget for windows, which in my experience is much better than task scheduler, if you are using a windows server.
Thanks for that guys. The reason I need to get PHP to handle the redirect is that in my example URL http://www.domain.com?info=xyz&info2=abc, xyz and abc are being pulled out of a database, and the destination URL needs to be hit at a delayed time from when the user enters their info into the system. I had a look in the PHP manual at shell_exec and a few other functions but can't seem to get any of them to work with wget. Any further suggestions? Thanks again.
Just in addition, I'm running on a shared Linux server so I'm wondering if I don't have permission to run wget commands ... ? Are there any other options? Thanks.
UPDATE: I did some more playing/looking and have got it working with cURL (http://us2.php.net/manual/en/function.curl-exec.php). Just thought I'd update this for any who might find it useful in the future. Thanks again.