I am trying to post data to a url from php. I have checked codes like below from this forum.
$url = 'http://www.someurl.com';
$myvars = 'myvar1=' . $myvar1 . '&myvar2=' . $myvar2;
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars);
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $ch, CURLOPT_HEADER, 0);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec( $ch );
But my target site has a captcha as well. How do I load the captcha on my php and submit it with captcha answer?
I had a look at the link. Didn't get the final solution though. How to retrieve captcha and save session with PHP cURL?
also How to retrieve captcha and save session with PHP cURL? and http://hungrycoder.xenexbd.com/general/how-to-submit-a-form-using-php-curl-fsockopen.html
My target site has code like below
<form method="post" action="action_form.php" name="frm_sms" id="frm_sms"> < input type="hidden" name="nav" value="sms" />
I don't need to bypass the captcha but I only want to load a neat form and captcha img but no other junk and submit info with captcha answer.