title: Creating checkboxes in HTML / PHP?
body: <p>So I have the following code.</p>
  
  <p>My main.html form lets me enter a value (a price for pc) and when I submit it calls the pcs.php script which displays all my pcs under the given value/price.</p>
  
  <p>But I want to have an checkbox beside the information displayed by the script. ie</p>
  
  <pre><code>&lt;br&gt;alienware, 3000, gtx760 checkbox &lt;br&gt;  asus rog, 2500, radeodhdxxxx checkbox &lt;br&gt;
  </code></pre>
  
  <p>and so on).</p>
  
  <p>//main.html
    </p>
  
  <pre><code> &lt;BODY&gt; 
   &lt;FORM METHOD="POST" ACTION="pcs.php" &gt;
    &lt;INPUT TYPE='textbox' NAME='mypc' VALUE='' &gt;
    &lt;INPUT TYPE="SUBMIT" NAME="Button" VALUE="Hit me"&gt; 
    &lt;/FORM&gt; &lt;/BODY&gt; &lt;/HTML&gt;
  </code></pre>
  
  <p>//pcs.php</p>
  
  <p> </p>
  
  <pre><code>&lt;?php
  $dd = $_POST['mypc'];
  
  
  $filename = "computer.txt";
  $filepointer = fopen($filename,"r");  
  $myarray = file ($filename);
  for ($mycount = 0; $mycount &lt; count($myarray); $mycount++ )
  {           
  
    $apc = $myarray[$mycount];  
    $price = getvalue($apc,1);
    $part = explode(',', $apc);
    //print $price ."&lt;br&gt;";
    //print $str ."&lt;br&gt;";
    if ($str &lt;$dd ) 
      { 
        for($pcount = 0; $pcount&lt;3; $pcount++) {
         print $part[$pcount] ."&lt;br&gt;";
  
      }
       print "&lt;br&gt;";
  
   }
  
  
  }
  
  
   function getvalue ($text, $commaToLookFor)
   {   
   $intoarray = explode(",",$text);
    return  $intoarray[ $commaToLookFor];  
  }
  
  // fclose ($filepointer);
  
  
   ?&gt; 
  
  
   &lt;p&gt;
  
   &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>
  
  <p>// computer.txt file</p>
  
  <pre><code>alienware, 3000, gtx760&lt;br&gt;
  asus rog, 2500, radeonhdxxx&lt;br&gt;
  alienware, 5000, gtx titan&lt;br&gt;
  </code></pre>