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

curl-and-php

translating post into cURL

From: Jeff Schwartz <jeff_schwartz_at_yahoo.com>
Date: Sat, 21 Sep 2002 18:08:24 -0700 (PDT)

I'm working on a program to access AOL mail. I can log in normally via the following post:

<form method=post action="https://my.screenname.aol.com/_cqr/login/login.psp?screenname=LOGIN&password=PASSWORD&submitSwitch=1&siteId=aolcomprod&mcState=initialized&authLev=1">
<input type="submit" value="submit">

However, when I try to do the same with cURL using:

<?php
$url = "https://my.screenname.aol.com/_cqr/login/login.psp";
$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
$postvars = "screenname=LOGIN&password=PASSWORD&submitSwitch=1&siteId=aolcomprod&mcState=initialized&authLev=1";
$cookie = "cookies/test";
@unlink($cookie);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec ($ch);
curl_close ($ch);
unset($ch);
echo "<PRE>".htmlentities($content);
?>

It delivers the cookie but stops, as though I had CURLOPT_RETURNTRANSFER turned off. Any ideas?

Thanks,

Jeff

---------------------------------
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-09-22