cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Redirect problem?

From: Phill Edwards <philledwards_at_gmail.com>
Date: Fri, 15 Dec 2006 21:02:52 +1100

> As was mentioned, try LiveHTTPHeaders and also, tell us what happens when it
> doesn't work.

The one line curl commands people recommended don't end up on the
members.php page (I can tell because of the <TITLE> tag). The only way
I've got as far as members.php is to use my horrible-looking double
curl command. But when I do get this far the info I'm after is not
populated, almost as if the username and password have failed
validation.

Here's what I get in LiveHTTPHeaders in Firefox:

--------------------------------------------------------------------------------------------------
http://www.freecall.net.au/main.php

POST /main.php HTTP/1.1
Host: www.freecall.net.au
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.freecall.net.au/main.php
Cookie: PHPSESSID=2bdc719989db278626606131200138cb
Content-Type: application/x-www-form-urlencoded
Content-Length: 35
name=987654&password=12345&x=27&y=7
HTTP/1.x 302 Found
Date: Fri, 15 Dec 2006 09:46:53 GMT
Server: Apache/2.0.46 (Red Hat)
Accept-Ranges: bytes
X-Powered-By: PHP/4.3.2
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Location: https://www.freecall.net.au/member.php
Connection: close
Content-Type: text/html
Transfer-Encoding: chunked
----------------------------------------------------------
https://www.freecall.net.au/member.php

GET /member.php HTTP/1.1
Host: www.freecall.net.au
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.freecall.net.au/main.php
Cookie: PHPSESSID=2bdc719989db278626606131200138cb

HTTP/1.x 200 OK
Date: Fri, 15 Dec 2006 09:46:54 GMT
Server: Apache/2.0.46 (Red Hat)
Accept-Ranges: bytes
X-Powered-By: PHP/4.3.2
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
----------------------------------------------------------

Does that shed any light on this? One thing I notice is that there are
2 fields called x and y which I haven't seen before. They seem to take
random values.

> Are you using a SSL-enabled curl? If so, is that site using a properly signed
> cert or do you need -k perhaps?

How do I tell if I've got an SSL-enabled curl or not? According to the
man page on my machine is does support SSL.

Regards,
Phill
Received on 2006-12-15