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

curl-and-php

Unable to access file or directory with Curl in PHP

From: sriram kumaran <sriram_kumaran_at_hotmail.com>
Date: Thu, 16 Jul 2009 23:33:53 +0530

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
Received on 2009-07-16