how to validate a form submit in php
<p>I have a form like this:</p>

<pre><code>&lt;form method="post" action=""&gt;
&lt;?php
$h = mysql_query("select distinct sous_sous_categorie, sous_sous_categorie_url  
                  from articles where sous_categorie_url='".$_GET["s_cat"]."' ");
while($hRow=mysql_fetch_assoc($h)){  
?&gt;
    &lt;span class="submit"&gt;
    &lt;input type="checkbox" name="&lt;?php echo $hRow["sous_sous_categorie_url"]; ?&gt;" 
     value="&lt;?php echo $hRow["sous_sous_categorie_url"]; ?&gt;" /&gt;&amp;nbsp;&amp;nbsp;
    &lt;a href="?categorie=&lt;?php echo $_GET["categorie"];  ?&gt;&amp;s_cat=&lt;?php echo $_GET["s_cat"]; ?&gt;&amp;s_s_cat=&lt;?php echo $hRow["sous_sous_categorie_url"];  ?&gt;"&gt;&lt;?php echo $hRow["sous_sous_categorie"];  ?&gt;&lt;/a&gt;
    &lt;/span&gt;
&lt;?php } ?&gt;
&lt;input type="submit" name="submit_sous_sous_categorie_search" 
 value="search" class="submit" /&gt;
&lt;/form&gt;
</code></pre>

<p>as you can see the form is in a loop, the form consists of checkboxes that user will check and accoding to this a search query will be made, the thing is that checkboxes have the name attribute but this attribute is variable (because it is fetch from the db) so my question is how can I make this:</p>

<pre><code>if(checkboxes are empty){
    echo "you must at least select one checkbox"
}
</code></pre>

<p>This is just an example but I dont see how to do a simple thing such as </p>

<pre><code>if(!$_POST["checkbox"]}{
    echo "you must at least select one checkbox";
}
</code></pre>

<p>Again, because the name of the checkboxes are variable.</p>
