cURL / Mailing Lists / curl-users / Single Mail

curl-users

Tricky auto-login - help needed

From: envision <envuk_at_zdaemon.org>
Date: Sat, 28 Apr 2007 12:10:24 -0400

Hi there.

The ISP piped into our building requires us logging in to the service through an html form (horrible, horrible thing). This wouldn't be a problem except that there are lots of redirects involved and hidden fields contained in a separate form to that of the user entered username and password.

So far I've managed to bypass the redirecting and hidden fields problem by saving a copy of the page onto my local webserver. I've loaded it up in a browser, entered my details, submitted and had the remote 'logged in' page appear - so no problems there.

However when I come to try the same thing with curl, the same login page gets spat at me from the remote server instead of the 'logged in' page. Why is this happening?

Command:
curl -F username=myusername -F password=mypassword http://localhost/login.html

Maybe I'm missing something here, but isn't this effectively the same thing I was doing in the browser?

The only possibility I can think of is that the form action page forwards the user to another page for it to take effect - can curl follow headers?

Many thanks,
Dan
             
Received on 2007-04-28