title: save checked checkbox php
body: <p>I need your help please to get something working.</p>
  
  <p>I've a kind of a link parser which put the links in an array and displays them with a checkbox at the beggining of every link.
  I've separated all the work into multiple files :</p>
  
  <ul>
  <li>Form.php which contains only the HTML form.</li>
  <li>Confing.php contains the necessary lines to connect to database.</li>
  <li>New.php contains the source
  and checkbox.php to save checked links in database.</li>
  </ul>
  
  <p>Now, what I want is to be able to save only checked links in the database, but instead it saves everything.</p>
  
  <p>Here's the code (in New.php) to add a checkbox to every link of the array :</p>
  
  <pre><code>// $r is the array
  
  for($i=0;$i&lt;sizeof($r);$i++)
  {
      echo "&lt;input type='checkbox' name='recup[]' value='".$r[$i]."'&gt;".$r[$i]."&lt;br&gt;";
  }
  $_SESSION[sup] = 
  </code></pre>
  
  <p>At the end of this file, an action to start checkbox.php :</p>
  
  <pre><code>&lt;form action="checkbox.php" method="post"&gt; 
  &lt;input type='submit' name='Submit' value='Submit'&gt;
  </code></pre>
  
  <p>The file chekbox.php :</p>
  
  <pre><code>&lt;?php 
  include("config.php");
  if($_POST["Submit"]=="Submit")
      {
          for ($i=0; $i&lt;sizeof($r);$i++) 
          {
              $query="INSERT INTO ub0oi_newcraw_liens(id,url,description) VALUE(NULL,'$r[$i]','Lien')"; 
              mysql_query($query) or die ('Error updating database');
              echo "Record is inserted.";
          }
      }
  ?&gt;
  </code></pre>
  
  <p>I Only want to save the checked value, please help me.</p>