cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Unable to access file or directory with Curl in PHP

From: Richard Lynch <ceo_at_l-i-e.com>
Date: Tue, 21 Jul 2009 13:04:22 -0500 (CDT)

action="/dir1/dir2/file1" in a HTML document is re-written by the
browser to include the domain name where the FORM appears.

Actually, it's a bit more complicated that that, depending on the
BASEURL tag...

So login by hand, and see where the FORM really POSTs, and use that URL.

On Thu, July 16, 2009 1:03 pm, sriram kumaran wrote:
>
> Hi,
> I am using Curl to access a webpage and post some data to a form.
>
> The login to the http webpage goes through successfully from curl.
> Once I am logged in, I have a form where I fill some data.
>
> Here is where I am facing the problem. The form has the following in
> it's action field
>
> <form name="XYZ" action="/dir1/dir2/file1" method="post">
>
> So, when I fill the fields in the form and try to post, the script
> does not work.
>
> I get the following in the Apache error log:
>
> [Wed Jul 15 09:58:04 2009] [error] [client 127.0.0.1] File does not
> exist: D:/wamp/www/dir1, referer: http://localhost/test/login.php
>
> I created a dummy directory structure like how the webpage expects,
> (i.e) I created dir1 and dir2 in my www folder of apache and then a
> dummy file called file1 inside dir2 and executed the script, it still
> it does not work
>
> When I set my curl options in php, I give something like,
> $POST_URL = "http://example.com/dir1/dir2/file1";
> curl_setopt($ch, CURLOPT_URL,$POST_URL);
>
> Is there a way to post the details of a form to a directory or file in
> curl?
>
> Thanks
> Sriram
>
>
> _________________________________________________________________
> Missed any of the IPL matches ? Catch a recap of all the action on MSN
> Videos
> http://msnvideos.in/iplt20/msnvideoplayer.aspx_______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>

-- 
Some people ask for gifts here.
I just want you to buy an Indie CD for yourself:
http://cdbaby.com/search/from/lynch
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2009-07-21