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

curl-and-php

RE: https:// Login and Cookies Being used

From: Andrew _at_ Jatech <_at_>
Date: Mon, 11 Aug 2003 12:30:49 -0400

I did this for a site with PHP running on a windows box and it worked, but
on Unix it wouldn’t allow multiple calls through the same handle !?

-----Original Message-----
From: curl-and-php-admin_at_lists.sourceforge.net
[mailto:curl-and-php-admin_at_lists.sourceforge.net]On Behalf Of Justin
Sent: August 11, 2003 12:27 PM
To: curl-and-php_at_lists.sourceforge.net
Subject: re: https:// Login and Cookies Being used

I figured it out!! yay..
I needed to call
 curl_setopt($ch, CURLOPT_URL, "FIRST URL");
 curl_setopt($ch, CURLOPT_URL, "SECOND URL");

all in the same session! woo!

here's the final script

<?
 set_time_limit(0);
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL,
https://manage1.sprintpcs.com/Manage?action=doLogin&target=Login&min=&passwo
rd=
<https://manage1.sprintpcs.com/Manage?action=doLogin&target=Login&min=&passw
ord=> );
 curl_setopt($ch, CURLOPT_COOKIEJAR, "my_cookies.txt");
 curl_setopt($ch, CURLOPT_COOKIEFILE, "my_cookies.txt");
 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_FOLLOWLOCATION,1);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 curl_setopt($ch, CURLOPT_URL, "
https://manage1.sprintpcs.com/Manage?layer=1&target=MyPlan&action=doMyPlanCu
rrentUsage
<https://manage1.sprintpcs.com/Manage?layer=1&target=MyPlan&action=doMyPlanC
urrentUsage> ");
 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_FOLLOWLOCATION,1);
 curl_setopt($ch, CURLOPT_COOKIEJAR, "my_cookies.txt");
 curl_setopt($ch, CURLOPT_COOKIEFILE, "my_cookies.txt");
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 echo curl_exec($ch);
 curl_close ($ch);
?>

thanks

Justin.

-------------------------------------------------------
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