cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Newbie question

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Sat, 29 Dec 2007 09:25:00 -0800

On Fri, Dec 28, 2007 at 05:00:14PM -0800, Ye, Wilson wrote:
> I trying to get this web login page working but seem to have encountered a
> problem but I can not seem to resolve the problem. Here's two format of
> passing the login and password to the login page using two different
> parameters:
>
> curl -d user=Nexx&password=Mu%244@%40p91&switch=Login%40In https://
> login.phxxx.com
>
> OR
>
> curl -F "user=Nexx" -F "password=Mu$V_at_p91" -F "switch=Login In" https://
> login.phxxx.com

-d and -F send two different types of forms to the server--you need to find
out which one is expected by the server and use that one (it's probably -d).
If that still doesn't work, you may need to turn on cookies support in
curl and do a request first to obtain a cookie.

> Questions:
>
> NOTE: I have the a secure login web page.
>
> 1. Using the two different methods, are these correct and if not, can you let
> me know what is specifically wrong I'm doing?

Not without seeing the form.

> 2. Also, how can I determine if I'm getting the correct result base on the
> output generated by the trace?

You can use the -v or --trace-ascii options to curl to see what it's sending,
which you may compare to the output of LiveHeaders in Firefox.

> BTW: It seems to be easy but it seems I'm missing a step or another parameter
> or something I'm trying to point down.

Probably true.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2007-12-29