NYCPHP Meetup

NYPHP.org

[nycphp-talk] cURL login to Squirrelmail

Jeffrey Stevison jeff at geeksociety.com
Sun Dec 26 12:27:26 EST 2004


I'm using the following to automatically login users to their web based  
email from our intranet.  I get a message from the browser "Can't open  
page blah because it could not load any data from this location"

I'm not sure if the problem is with my cURL code or squirrelmail.  Here  
is the code:

     session_start();

	$ch = curl_init();
	
	curl_setopt($ch, CURLOPT_URL,"http://mysite/webmail/src/redirect.php");
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS,  
"login_username=".$_SESSION['Username']."&secretkey=".$_SESSION['Passwor 
d']."&js_autodetect_results=0&just_logged_in=1");
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
	
	curl_exec ($ch);
	curl_close ($ch);


Jeff




More information about the talk mailing list