UrbelT Posted September 29, 2006 Share Posted September 29, 2006 I am trying to run a curl to emulate the following form: http://peterl.storefrontx.com/list/index.php?p=subscribe&id=2I don't know if its the <form> name tag, or the hidden list[2] and listname[2] tags that are messing it up but its not working. Can anyone tell me what curl postfield vars I should use to properly emulate the post?Thanks![code] $postfields = 'p=subscribe&id=2&email='.$_POST['email'].'&emailconfirm='.$_POST['email'].'&list[2]=signup&listname[2]="Lambrou\'s Newsletter"'; $url = "http://peterl.storefrontx.com/list/index.php"; // initialise Curl $popPost = curl_init(); curl_setopt($popPost, CURLOPT_URL, $url); // Set Curl Option: Username:Password curl_setopt($popPost, CURLOPT_POST, 1); // Set Curl Option: Collect result from script curl_setopt($popPost, CURLOPT_RETURNTRANSFER, 1); // Set Curl Option: Set timeout to 15 seconds curl_setopt($popPost, CURLOPT_TIMEOUT, 15); // Set Curl Option: Post data curl_setopt($popPost, CURLOPT_POSTFIELDS, $postfields); // Execute Request, and store result in $tb_post $popPost_result = curl_exec ($popPost); // Close Curl curl_close ($popPost);[/code] Quote Link to comment 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.