cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: problem using curl to grab cgi script output

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 22 Nov 2006 09:19:05 -0800

On Wed, Nov 22, 2006 at 11:34:32AM -0500, Ian Downard wrote:
> I'm trying to use curl to grab the output of a cgi script, which gets
> invoked
> after I submit a username and password on an authentication page. Here's my
> command:
>
> curl -d "Username=myuser&Password=mypass&press=Submit"
> "http://myhost.mydomain.com/calendar.acgi"
>
> to which curl only outputs the following line:
>
> </html>r>/tr></table> colspan=2><IMG SRC=../images/clear.gif BORDER=0
> WIDTH=1 HEIGHT=5></td></tr>
>
> When I actually login in via Firefox, I get my HTML formatted calendar
> which I
> expect from the cgi program. Why is curl only giving me this one line, and
> not
> my HTML formatted calendar?

Are you sure the curl line is providing all the same parameters as Firefox?
Is there any Javascript or cookie machinations going on that might obscure
this? If it is correct, then it's probably a matter of the script
customizing its output by looking at the User-Agent and failing to
provide a sane default. Try adding a -A option with a string that mimics
Firefox and see if that helps.

>>> Dan

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