title: curl checking a checkbox
body: <p>I have a simple php curl function that goes to another site(not owned by me) and fills in the fields and works properly the only thing is i cant get it to check a check box. i cant seem to find an answer.</p>
  
  <pre><code>curl_setopt($ch, CURLOPT_HEADER, false);
  
  curl_setopt($ch, CURLOPT_NOBODY, false); 
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 
  
  curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); 
  curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); 
  
  curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7"); 
  
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_VERBOSE, 1);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); 
  curl_setopt($ch, CURLOPT_POST, 1); 
  $searchCriteria = array(
        'historicalMatches' =&gt; $_POST['historicalMatches'],  //the checkbox
        'firstName'  =&gt; $_POST['firstName'], 
        'middleName' =&gt; $_POST['middleName'],
        'lastName'   =&gt; $_POST['lastName'], 
        'suffix'     =&gt; $_POST['suffix'],
        'age'        =&gt; $_POST['age'],
        etc..);
  
  curl_setopt($ch, CURLOPT_POSTFIELDS, $searchCriteria);  
  </code></pre>
  
  <p>i have tried setting the value to 1 and on and checked. The html for the checkbox on the other page is: </p>
  
  <pre><code>&lt;input type="checkbox" name="historicalMatches" value="on"&gt;
  </code></pre>
  
  <p>all i need to do is make sure it is checked everytime. So i can add a 2nd </p>
  
  <pre><code>curl_setopt($ch, CURLOPT_POSTFIELDS, 'check the box');
  </code></pre>
  
  <p>that just clicks the box I just cant figure it out. Thanks</p>