i know strange question..
so i'm doing some cURL and have a checkbox name 'accept' i want to send as checked..
how does the 'accept' checkbox look like in the form post? is it accept=checked or accept=1?
the form:
Code:
<form method="GET" action="post.php">
<input type=text name="first_name">
<input type=checkbox name="accept">
<input type=submit name=press value="OK">
</form>
the curl:
PHP Code:
<?
$url='http://www.mysite.com/post.php';
$first_name='Jerry';
$postfields='first_name='.$first_name.'accept=1';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1); //
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data=curl_exec($ch);
curl_close($ch);
echo $data;
?>
is the 'accept' supposed to =1 or =checked?