ok thank u for the reply..
Finally I got curl working.. i can login and get this by return
HTTP/1.1 302 Moved Temporarily Server: Netscape-Enterprise/6.0 Date: Wed, 13 Aug 2003 07:19:54 GMT Content-type: text/html;charset=ISO-8859-1 Set-cookie: JSESSIONID=www.domain.com-3030%253A3f39e697%253A2530cfe1bfc7565;path=/ Set-cookie: vodafone_loggin=true;expires=Wed, 13-Aug-2003 07:50:05 GMT Location: [url]https://www.domain.com/my/index.jsp...f2f2612df7b5f8e[/url] Transfer-Encoding: chunked
The code I have used is this
txtUserID= "xxx";
$txtPassword = "xxx";
$cookie_jar= tempnam('c:\Windows\Temp','cookie');
$postfields = "txtUserID=$txtUserID&txtPassword=$txtPassword&txtKeyCode=&url=/my/index.jsp&pcode=sol&pinfo";
$user_agent="Mozilla/4.0";
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 1); // Get the header
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // Allow redirection
curl_setopt($ch, CURLOPT_REFERER, "http://www.domain.com/index.jsp");
curl_setopt($ch, CURLOPT_COOKIEJAR, "$cookie_jar");
curl_setopt($ch, CURLOPT_COOKIE, "$cookie_jar");
curl_setopt($ch, CURLOPT_URL,
"https://www.domain.com/knox/login_handler.jsp");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "$postfields");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
ob_start();
$buffer=curl_exec($ch);
ob_end_clean();
//$result=curl_exec($ch);
curl_close($ch);
echo "$buffer";
When i try to go to restricted area it does not recognised me as member....
And i have tried to use curl to see what happen if i try to access to restricted area ....after executing above code
$c = curl_init('http://www.domain.com/yrweb2txt/messages/sendmessageuicontroller.jsp');
curl_setopt($c, CURLOPT_HEADER, 1); // Get the header
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_COOKIEFILE, $cookie_jar);
$page = curl_exec($c);
curl_close($c);
echo"<hr>";
echo "$page";
echo"$cookie_jar";
Why i get empty cookie file ??