hi all,
I'm searching all around the web without any good answer, maybe you have
the right one.
I'm trying to fill&send a form on a site authenticated https via curl.
The problem is simply that it doesn't arrives to authenticate..
It returns id error1 -> unsupported protocol.
The code is the following:
<?php
$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
$login_url = "https://www.my_site.com/login";
$login_data = "username=my_us er_name&passwor d=my_pass";
$form_url = "https://www.my_site.com/form";
$form_data ="input1=walla& input2=test";
$ch = curl_init($logi n_url);
curl_setopt($ch , CURLOPT_SSLVERS ION, 3);
curl_setopt($ch , CURLOPT_SSL_VER IFYHOST, 2);
curl_setopt($ch , CURLOPT_SSL_VER IFYPEER, FALSE);
curl_setopt($ch , CURLOPT_RETURNT RANSFER, 1);
curl_setopt($ch , CURLOPT_VERBOSE , 1);
curl_setopt($ch , CURLOPT_USERAGE NT, $user_agent);
curl_setopt($ch , CURLOPT_COOKIEJ AR, "curl_cookies") ;
curl_setopt($ch , CURLOPT_COOKIEF ILE, "curl_cookies") ;
curl_setopt($ch , CURLOPT_POSTFIE LDS, $login_data);
$body = curl_exec($ch); // login
curl_setopt($ch , CURLOPT_POST,1) ;
curl_setopt($ch , CURLOPT_URL, $form_url);
curl_setopt($ch , CURLOPT_POSTFIE LDS, $form_data);
$body = curl_exec($ch); // get form results
echo "error curl_errno ($ch) <br>"; //it return error id1
curl_close($ch) ;
?>
Thank you very much
SHE
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
I'm searching all around the web without any good answer, maybe you have
the right one.
I'm trying to fill&send a form on a site authenticated https via curl.
The problem is simply that it doesn't arrives to authenticate..
It returns id error1 -> unsupported protocol.
The code is the following:
<?php
$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
$login_url = "https://www.my_site.com/login";
$login_data = "username=my_us er_name&passwor d=my_pass";
$form_url = "https://www.my_site.com/form";
$form_data ="input1=walla& input2=test";
$ch = curl_init($logi n_url);
curl_setopt($ch , CURLOPT_SSLVERS ION, 3);
curl_setopt($ch , CURLOPT_SSL_VER IFYHOST, 2);
curl_setopt($ch , CURLOPT_SSL_VER IFYPEER, FALSE);
curl_setopt($ch , CURLOPT_RETURNT RANSFER, 1);
curl_setopt($ch , CURLOPT_VERBOSE , 1);
curl_setopt($ch , CURLOPT_USERAGE NT, $user_agent);
curl_setopt($ch , CURLOPT_COOKIEJ AR, "curl_cookies") ;
curl_setopt($ch , CURLOPT_COOKIEF ILE, "curl_cookies") ;
curl_setopt($ch , CURLOPT_POSTFIE LDS, $login_data);
$body = curl_exec($ch); // login
curl_setopt($ch , CURLOPT_POST,1) ;
curl_setopt($ch , CURLOPT_URL, $form_url);
curl_setopt($ch , CURLOPT_POSTFIE LDS, $form_data);
$body = curl_exec($ch); // get form results
echo "error curl_errno ($ch) <br>"; //it return error id1
curl_close($ch) ;
?>
Thank you very much
SHE
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
Comment