cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Logging into a site

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 14 Dec 2005 09:34:46 +0100 (CET)

On Tue, 13 Dec 2005, ccs wrote:

> I am tyring to log into my account at www.mydomain.com and update an IP
> address on a page.
>
> When I use a PHP script, it returns a blank page or the value 1 -- however,
> I can log into the site from a DOS command window (running NT4).

Well, they probably don't send the exact same requests. For example I belive
the PHP/CURL interface doesn't set the user-agent field.

Let me also point out that there's a separate mailing list for PHP/CURL,
called curl-and-php.

> I've read the docs, FAQS, and about login issues (i.e., referer, user agent,
> certification, etc., etc.). But can't seem to figure out where or what to
> look for. (I guess I'm stumped partly because I can login from a DOS command
> window.)

You need to figure out the differences and make the non-working request more
similar to the working one. I believe the --trace and CURLOPT_VERBOSE options
will help you with that.

> I can't actually update this page from the DOS command window because the
> POST values are almost 2.5KB (far longer than a command line can be).

curl can send POSTs read from a file or stdin, so this should be possible
anyway.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-12-14