curl - PHP form to moneris through google recaptcha -
i have simple php form sends information moneris through google recaptcha verification.
that means cannot write "https://esqa.moneris.com/hppdp/index.php">" need google recaptcha verification.
is there way if can submit form in php code takes users page https://esqa.moneris.com/hppdp/index.php form values.
i using curl displaying result url website https://esqa.moneris.com/hppdp/index.php not working want users go above url post information.
my curl code not working
$url = 'https://esqa.moneris.com/hppdp/index.php'; $fields = array( 'ps_store_id'=>urlencode('gdtj4tore1'), 'hpp_key'=>urlencode('hpajl6hnusec'), 'charge_total'=>urlencode('1.00'), ); foreach($fields $key=>$value) { $fields_string .= $key.'='.$value.'&'; } rtrim($fields_string,'&'); // google recaptcha $recaptcha_secret = "secret key"; $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$recaptcha_secret."&response=".$_post['g-recaptcha-response']); $response = json_decode($response, true); if($response["success"] === true) { $ch = curl_init(); curl_setopt($ch,curlopt_url,$url); curl_setopt($ch,curlopt_post,count($fields)); curl_setopt($ch,curlopt_postfields,$fields_string); $result = curl_exec($ch); curl_close($ch); } else { echo "error"; }
wiki
Comments
Post a Comment