ballhogjoni Posted October 5, 2009 Share Posted October 5, 2009 What is wrong with this curl code? $post_url = "http://www.ddsfgfdre.com/signup/dbsignup.php?p=65f1764b8142e6efc4eaeb743d5ec99d&document_url=http%3A%2F%2Fdvcfn.ededfdns.info%2F&referer=http%3A%2F%2Ffacebook.com&FirstName=Chester&EmailAddress=sdgfsfg%40yahoo.com&phone1=345&phone2=321&phone3=9087&ZipCode=84660&Dezdfgount=%24500-%242500&ActionButton=Makefree"; $ch = curl_init(); print_r($post_url); curl_setopt( $ch , CURLOPT_URL , $post_url); //the url curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 4s curl_setopt($ch, CURLOPT_POST, true); // set POST method $ret = curl_exec($ch); curl_close($ch); Quote Link to comment https://forums.phpfreaks.com/topic/176511-curl-issue-not-posting/ Share on other sites More sharing options...
MadTechie Posted October 5, 2009 Share Posted October 5, 2009 well you have set CURLOPT_POST but passed nothing to post! (no CURLOPT_POSTFIELDS) EDIT: example <?php $curl = curl_init(); curl_setopt($curl, CURLOPT_URL,"http://localhost/posttest.php"); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, "Hello=World&Foo=Bar&PHP=Freak"); curl_exec ($curl); curl_close ($curl); ?> Quote Link to comment https://forums.phpfreaks.com/topic/176511-curl-issue-not-posting/#findComment-930441 Share on other sites More sharing options...
ballhogjoni Posted October 5, 2009 Author Share Posted October 5, 2009 sweet dude thx! Quote Link to comment https://forums.phpfreaks.com/topic/176511-curl-issue-not-posting/#findComment-930442 Share on other sites More sharing options...
MadTechie Posted October 5, 2009 Share Posted October 5, 2009 Welcome Solved ? (we have a button to mark it as solved if it is) Quote Link to comment https://forums.phpfreaks.com/topic/176511-curl-issue-not-posting/#findComment-930453 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.