I want to use cURL to post some data to an external URL, here is the code they ask to embed, for some technical needs I need to create my own form action so I need cURL so POST those data: This is what I am asked to embed:
<form action='https://external.com/blabla' name=715000002374001 method='POST'>
<input type='text'name='xnQsjsdp' value='c942f375287f707b73'/>
<input type='hidden' name='zc_gad' id='zc_gad' value=''/>
<input type='text'name='xmIwtLD' value=1aff1efd0a4'/>
<input type='text' name='actionType' value='TGVhZHM='/>
<input type='text' name='returnURL' value='http://www.blabla.de' />
</form>
I try to make it with cURL :
$data = 'xnQsjsdp=c942f375287f707b73&xmIwtLD=TGVhZHM&actionType=TGVhZHM&returnURL&http://www.blabla.de';
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,'https://external.com/blabla');
curl_setopt($ch, CURLOPT_URL,$url);
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data );
$res = curl_exec ($ch);
curl_close ($ch);
But seems not to be working !!!