hi, im making a script so that i can submit articles to all of my site at once i have got so far but i dont know how to post it... the form that is on the the sites is a post not get so i dont know how to do it... i have a foreach site in array to do this.. curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"); curl_setopt ($ch, CURLOPT_TIMEOUT, 60); curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_REFERER, 'http://www.google.com/'); $AskApache_result = curl_exec ($ch); PHP: but i dont know how to get it to submit... what it needs to do is for me to fill out a form (for the article) then when i submit, it needs to look up the sites i want to post to (in the form before post) then go to the url(in the with in the script and post the information to the url) then echo that it has posted it to that site... if anyone could help i will return the favour.
im trying this on another script at the moment... here it is: <? if($_POST) { $domains = explode("\n", $_POST[domains]); // initialise Curl $data = array('ACTION' => 'ADD', 'config' => 'calendar.cfg', 'Month' => '1' , 'Date' => '9' , 'annual' => '1' , 'heading' => '1' ); $data1 = "ACTION=ADD&config=calendar.cfg&Month=1&Date=9&annual=1&heading=1"; foreach($domains as $domain) { $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $domain); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"); curl_setopt ($ch, CURLOPT_TIMEOUT, 60); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_REFERER, 'http://www.google.com/'); $AskApache_result = curl_exec ($ch); $regex = '/<title>(.+?)<\/title>/'; preg_match($regex,$AskApache_result,$output); echo $output[1] . '<br>'; flush(); ob_flush(); if(preg_match('/ENTRY ADDED/', $AskApache_result)) { echo $domain . ' - Pinged!<br>'; } else { echo $domain . ' - <b>Pinging Failed!</b><br>'; } flush(); ob_flush(); } } else { ?> <form method="post"> Links:<br> <textarea name="domains" cols=100 rows=30></textarea><br> <br> <input type="submit"> </table> </form> <? } ?> PHP: