curl-and-php
https:// Login and Cookies Being used
Date: Mon, 11 Aug 2003 11:34:02 -0400
Hello List..
I have been working with this script.
-------------------------------
<?
set_time_limit(0);
$submit_url = "https://manage1.sprintpcs.com/Manage";
$formvars['action'] = "doLogin\n";
$formvars['target'] = "Login\n";
$formvars['min'] = "*********\n";
$formvars['password'] = "*******\n";
$ch = curl_init($submit_url);
curl_setopt($ch, CURLOPT_COOKIEJAR, "my_cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "my_cookies.txt");
curl_setopt($ch, CURLOPT_REFERER, "https://manage1.sprintpcs.com/Manage");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $formvars);
$lines = curl_exec($ch);
curl_close ($ch);
$submit_url = "https://manage1.sprintpcs.com/Manage";
$formvars['layer'] = "1\n";
$formvars['target'] = "MyPlan\n";
$formvars['action'] = "doMyPlanCurrentUsage\n";
curl_setopt($ch, CURLOPT_COOKIEJAR, "my_cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "my_cookies.txt");
curl_setopt($ch, CURLOPT_REFERER, "https://manage1.sprintpcs.com/Manage");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $formvars);
$ch = curl_init($submit_url);
curl_setopt($ch, CURLOPT_COOKIE, "my_cookies.txt");
echo curl_exec($ch);
curl_close ($ch);
?>
-------------------------------
I'm 'trying' to get into my Account info and echo that page. but the only thing it does is echo's the login screen page (where you enter your user id / password) So what I'm thinking is the cookie isn't being sent right or somehow I'm not seeing something else.. I've been working on this all day Friday and now all morning today =) so I figured I'd ask for a little help from the list to get some pointers on whether I'm doing something wrong or not.
Thanks a lot!
Justin.
m
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-08-11