header - Auto Submit URL generated by PHP script from Cron -
I wrote a small script, grabbing data from XML file I need some XML data to generate URLs. I am looking for a function, how do I 'use' a form I submit to this generated URL, 'deposit' (automatically sending) the script is executed by cron job and works 'hands-free'.
Here are some parts of my script Thanks for your help!
& lt ;? Php $ xml = simplexml_load_file ("xml.xml"); // XML $ GUST = $ xml- & gt; Make some differences from the Guste; // I can generate a working link ... echo "& lt; a href = 'http: // anywhere & amp; gust =". $ Gust "& TR = T" & gt; Activity Link & lt; / a & gt; "; // But I try to send this generated url from this cron job. //... no info...?
You can use curl to post to the URL can do. Here's an example:
$ dataToPost = array ('name' = & gt; 'Ross'); $ Handle = curl_init ($ urlToPostAt); Curl_setopt ($ handle, CURLOPT_POST, true); Curl_setopt ($ handle, CURLOPT_POSTFIELDS, $ data); Curl_exec ($ handle); Please note curl should be enabled in your php.ini
Comments
Post a Comment