Hello all, I am using PHP curl function to login in secure server site by post the parameters. My code is as follows: cookie_jar = tempnam('tmp/','cookie'); $url = "https://nameos site/login"; $POSTFIELDS = 'session_key=emailid&session_password=password&session_login=&session_rikey=invalid key'; $reffer = "http://www.securesitename.com"; $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"; $cookie_file_path = "tmp/"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$POSTFIELDS); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_REFERER, $reffer); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); echo $result = curl_exec($ch); exit; curl_close($ch); PHP: But the login does not done. Pls help me to do login.. Is any special parameters need when we use CURL for secured site? Thanks,
echo is used before exit so it will have no effect on echo. Can u tell us the site, then may be I can help you
What result to you actually get from the above code? Bad username/password? Does it look like your secure page reads the parameters you post?