curl-and-php
Re: Post Form id
Date: Tue, 12 Oct 2004 14:24:03 +0200
* and then Matjaz Pfefferer declared....
> <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">
>
> $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);
> ?>
The id is not what the test.asp is checking, im not even sure you *can*
do that, in fact, i am sure! you cant! ;-)
My guess is if you added this line:
> curl_setopt($ch, CURLOPT_POSTFIELDS,
> "var1=1&var2=2&var3=3&button=push");
it would work...
-- Nick WReceived on 2004-10-12