RabPHP Posted August 23, 2006 Share Posted August 23, 2006 Greetings,I am attempting to create a form post for a 3rd party training website. Essentially I want to post the data over, but not have the client redirected to their login after the post is completed.The post data works and the 3rd party site registeres the entry, but I don't want their confirmation or the page the redirect for normal users to be displayed. My code is as follows....[code]$ch = curl_init();curl_setopt($ch, CURLOPT_URL,"http://someURL");curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, "mft_userID=$username&mft_Pwd=$password&mft_Fname=$fname&mft_Lname=$lname&mft_userEmail=$email&mft_GrpID=$GroupID");curl_exec ($ch);curl_close ($ch);[/code]I believe their are CURL options to do this, but I cannot find a good reference on the options. I want the user to stay on my page after the post. Any ideas greatly appreciated.Rab Link to comment https://forums.phpfreaks.com/topic/18483-php-curl-form-post-without-redirecting/ Share on other sites More sharing options...
trq Posted August 23, 2006 Share Posted August 23, 2006 Try...[code=php:0]curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);[/code] Link to comment https://forums.phpfreaks.com/topic/18483-php-curl-form-post-without-redirecting/#findComment-79574 Share on other sites More sharing options...
RabPHP Posted August 23, 2006 Author Share Posted August 23, 2006 Tried that, didn't work. Still redirects to their login page.Rab Link to comment https://forums.phpfreaks.com/topic/18483-php-curl-form-post-without-redirecting/#findComment-79579 Share on other sites More sharing options...
trq Posted August 23, 2006 Share Posted August 23, 2006 You could maybe also try setting CURLOPT_MAXREDIRS to 0. Im not sure really, havent used curl before. Link to comment https://forums.phpfreaks.com/topic/18483-php-curl-form-post-without-redirecting/#findComment-79590 Share on other sites More sharing options...
RabPHP Posted August 23, 2006 Author Share Posted August 23, 2006 No love with that either.Rab Link to comment https://forums.phpfreaks.com/topic/18483-php-curl-form-post-without-redirecting/#findComment-79597 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.