cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Auto Login.......

From: chinni munni <108.jadav_at_gmail.com>
Date: Thu, 28 May 2009 15:00:02 +0530

Hello.......... every one

I am using php and curl options to login to one website........ that means
when i click the link button...directly it has to go to the website homepage
without asking username and passward... as i wrote the username and
password in the SCRIPT.... when i click the link button the SCRIPT helps to
open that website homepage..

Here is my code

<?php
$userid=urlencode('AAAA' <'jlakshmi@'>);
$passwd="xxxx";
$gacookie="./.iisccookie";
$postdata="userid=".$userid."&passwd=2898&sub=Sign+In";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL,"https://secure.fluent.com/sso2/check_user.htm
");
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10");
curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $gacookie);
curl_setopt ($ch, CURLOPT_COOKIEFILE, $gaccookie);
curl_setopt ($ch, CURLOPT_REFERER, '
http://www.fluentusers.com/sso2/getencrypt.htm');
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt ($ch, CURLOPT_POST, 1);
$AskApache_result = curl_exec ($ch);
curl_close($ch);
echo $AskApache_result;
//unlink($gacookie);
exit;
?>

But its not working....Is anything wrong here.... plz let me know....

And onething is the COOKIES are not created perfectly.....please anyone
suggest me...

Thanks in advance
Regards
Soumya Jadhav

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2009-05-28