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

curl-and-php

Re: Re[6]: Sessions in CURL

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 12 Jun 2001 16:28:00 +0200 (MET DST)

On Tue, 12 Jun 2001, Vladimir wrote:

> DS> The "action" is the URL to use, which in this case tells you to POST to the
> DS> url "http:/blablabla/index.asp?UserName=something&somedata=somedata".
>
> DS> The CURLOPT_POSTFIELDS should then contain "Type=Common" or "Type=Other",
> DS> depending on which button you want it to look like you're pressing.
>
> I did this, but it is something else

In your source code shown below, you do not.

It could of course be something else anyway.

> My be the problem is in cookie I received ??

Could be.

> I receive curl_setopt($ch, CURLOPT_COOKIEFILE, "111.txt"); in the
> first page

You don't receive cookies by issuing that function call. You tell curl to
read already stored cookies from a file named "111.txt". It also activates
curl's cookie parser.

> $file = fopen("111.txt", "w+");

This does nothing good, afaict.

> $ch = curl_init();

 [snip]

> curl_exec($ch);
>
> !!!!!!
> The first page is working fine I get the second page into the Browser
> or file it depends of commented rows
> !!!!!!
>
> $request="Name=Name&Operand=23236&OperID=16614&Type=Other";

You were supposed to modify the URL and post only the type thing. At least if
you're still trying to fill in the form you posted about previously.

Thus,

$url="https://secure.server.com/index.asp?Name=Name&Operand=23236&OperID=16614";
$request="Type=Other";

> curl_setopt($ch, CURLOPT_TIMEOUT, 120);
> curl_setopt($ch, CURLOPT_URL, "https://secure.server.com/index.asp");

instead make that

curl_setopt($ch, CURLOPT_URL, $url);

[snip]

> The second part has troubles. ?????

You simply have to understand the concepts of GET and POST. Otherwise you'll
never get this right.

-- 
     Daniel Stenberg -- curl dude -- http://curl.haxx.se/
_______________________________________________
Curl-and-php mailing list
http://curl.haxx.se/
Received on 2001-06-12