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

curl-and-php

Post Form id

From: Matjaz Pfefferer <matjaz88_at_hotmail.com>
Date: Tue, 12 Oct 2004 13:43:48 +0200

Hi,

 

I hope someone can help me with a small info.

 

 

I 'm trying to post following form data using cURL to IIS server (not under
my control), but remote site is obviusely checking >form id<.

Question is how to send >form id< via cURL?

 

HTML

<form id=admin action="www.somesite.com/test.asp" method="POST">

<input type="hidden" name="var1" value="1">

<input type="hidden" name="var2" value="2">

<input type="hidden" name="var3" value="3">

    <input type="submit" name="button" value="push">

</form>

 

PHP + cURL

<?

$ch = curl_init();

 

curl_setopt($ch, CURLOPT_URL," www.somesite.com/test.asp");

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_HEADER, 1);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS,

            "var1=1&var2=2&var3=3id=admin");

 

curl_exec ($ch);

curl_close ($ch);

?>

 

 

Any Ideas?

 

Thx, Robert
Received on 2004-10-12