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

curl-and-php

Re: Form Post in php with cURL

From: PDQ <as400_at_pdq.net>
Date: Mon, 19 Apr 2004 12:48:15 -0500

Daniel,

...thanks for your time.

Changing the CURLOPT_COOKIEFILE from integer to a string (file name) didnt
work, same message.
Below is the header information aftering setting CURLOPT_COOKIEFILE.
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie");

I was able to get what was expected by changing one of the POST parm, from
'op=1013' to 'op=1000'
but doesnt really solve the orginal problem - trying to simulate the
original '<form> which uses 'op=1013' to cURL.

NOTE: ... thanks for all your effort & sharing your tools with us - plus,
formfind.pl rocks

joe mcdonald

------------------------------------
HTTP/1.1 302 Moved Temporarily Date: Mon, 19 Apr 2004 17:35:45 GMT Server:
Apache/1.3.29 (Unix) mod_perl/1.29 Location:
http://seeker.dice.com/seeker.epl?rel_code=1102&op=6 Set-Cookie:
JSESSIONID=AENzOJ6bREe3qS15iBFG6q9H512Ay6r1oFe2ZvxdR1JmZLWXlXPY!1246167922!-
327344161; path=/ Set-Cookie: ADKW=php; domain=seeker.dice.com; path=/
Transfer-Encoding: chunked Content-Type: text/html HTTP/1.1 302 Moved
Temporarily Date: Mon, 19 Apr 2004 17:35:45 GMT Server: Apache/1.3.29 (Unix)
mod_perl/1.29 Location: http://seeker.dice.com/seeker.epl?rel_code=1102&op=6
Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1

Moved Temporarily

The document has moved here.

Additionally, a 302 Found error was encountered while trying to use an
ErrorDocument to handle the request.

----------------------------------------------------------------------------

----
Apache/1.3.29 Server at seeker.dice.com Port 80
0 HTTP/1.1 200 OK Date: Mon, 19 Apr 2004 17:35:46 GMT Server: Apache/1.3.29
(Unix) mod_perl/1.29 Set-Cookie: D2SESS=fde3637151f5a717245f29ee0aabce00;
domain=.dice.com; path=/ Set-Cookie: REL_CODE=1102; domain=.dice.com; path=/
Set-Cookie: VISIT50322=f40b06181d55fde0b66bf53bc5ab8a07; domain=.dice.com;
path=/; expires=Sun 03-Jan-2010 12:00:00 GMT; Content-Length: 869
Content-Type: text/html
------------------------------------
----- Original Message ----- 
From: "Daniel Stenberg" <daniel-curl_at_haxx.se>
To: "using curl with PHP" <curl-and-php_at_cool.haxx.se>
Sent: Monday, April 19, 2004 2:55 AM
Subject: Re: Form Post in php with cURL
> On Fri, 16 Apr 2004, PDQ wrote:
>
> > I am trying to implement the form below using cURL & php, expecting a
list
> > of jobs returned. The one thing I dont understand is the form 'action'
it
> > appears to be a directory instead of a script or cgi because there is no
> > extension at the end of 'JobSearch'. Regardless the form below works but
the
> > cURL right below it doesnt, the cURL returns HTTP/1.1 302 Moved
> > Temporarily...
>
> If you don't show us what headers you send and receive, it is hardly
> impossible to even guess what happens. A 302 is usually sent back with a
> Location: header as well which curl should follow...
>
> > curl_setopt($ch, CURLOPT_COOKIEFILE, 1);
>
> This is not used correctly, unless your file name really is 1? I suspect a
> lack of cookies is your problem.
>
> -- 
>      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
>       Dedicated custom curl help for hire: http://haxx.se/curl.html
>
Received on 2004-04-19