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


RE: Need to pull header fields out of https post reply

From: Fluteau Jerome ICM N PG U PLM A 2 <>
Date: Fri, 22 Nov 2002 08:57:07 +0100

>From a browser, I do get back a body
>saying invalid username,password

I'm not sure to well understand what you enter a site, get the HTML
code from your login page,
put all the input names from your HTML code into your URL:

HTML code example:

<FORM NAME='loginForm' method='post' action='/script/connect'>
<input type='hidden' name='action' value='Login'/>
<input type='hidden' name='target' value='_top'/>
<tr><td>username:</td><td><input type='text' name='username'/></td></tr>
<tr><td>password:</td><td><input type='password' name='password'/></td>
<td><A HREF='javascript:document.loginForm.submit()'>login</A></td></tr>

And try the URL resulting:

Sometimes the *non* hidden inputs are not required, but I already had
problems because of it, so...

>but from within my php script, nothing comes back.

If you didn't give your username and password that's normal. With the same
HTML example you can try this:

$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL,
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
ob_start(); // prevent any output
curl_exec ($ch); // execute the curl command

curl_setopt ($ch, CURLOPT_URL,
curl_setopt ($ch, CURLOPT_HEADER, 1);
$string = ob_get_contents();
echo $string;

Try the URL connection in your browser first, just to be sure that you
didn't forget anything.

>What is the minimum version of libcurl needed to do https??
I don't think that the problem comes from libcurl here...
I use this kind of code for 1 month, and it works perfectly.

Hope this helps.

This email is sponsored by:ThinkGeek
Welcome to geek heaven.
Received on 2002-11-22