I'm trying to set up a script, that allows me to publish ads at different websites without user interference. I'm using PHP cURL and the script is working fine on localhost. However, it does nothing on
This is a Lithuanian advertising website. The form has 3 parameters - you'll find them in the code. The script works without error/warning, but the post is obviously not done. You would be able to see it at http://www.nsl.lt/1n.../82-tinklapiai/
// Parameters to be sent $url = 'http://www.nsl.lt/index.php?view=post&cityid=1&lang=en&catid=12&subcatid=82&adid=0&imgid=0&countryid=0&areaid=0&pos=0&picid=0&page=0&foptid=0&eoptid=0&pricemin=0&pricemax=0&'; $curlPost = 'adtitle=' .urlencode('Title'). '&addesc=' .urlencode('Aprasymas'). '&agree=' .urlencode('1'); // cURL $c = curl_init(); curl_setopt($c, CURLOPT_URL, $url); curl_setopt($c, CURLOPT_HEADER, 1); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_POST, 1); curl_setopt($c, CURLOPT_POSTFIELDS, $curlPost); curl_exec ($c); // Three lines below for debugging print_r(curl_getinfo($c)); echo "\n\ncURL error number:" .curl_errno($c); echo "\n\ncURL error:" . curl_error($c); curl_close ($c);
Does anybody had any previous experience on cURl. Any kind of help will be highly appreciated!