title: How to create a ecommerce filter with php using the GET method
body: <p>I know there are better ways to do it, but I really need to create a multiple parameter filter with PHP only in order to filter items by from a json. </p>
  
  <p>The categories are separated by Gender, type of Item, colors etc... I want to be able to select multiple categories, and if only gender is set to show all products, call them using the $_GET method and be able to filter using IFs. </p>
  
  <p>The problem is that my amateur coding skills are not helping much, and I am also not sure if without AJAX there is a better way to do this.</p>
  
  <p>This is what part of my filter looks like: </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;ul class="category-menu" name="categoria"&gt;         
      &lt;li&gt;&lt;a href="page.php?genid=&lt;?php echo $genid;?&gt;&amp;cat=remeras&amp;col=&lt;?php echo ($_GET["col"]);?&gt;&amp;mar=&lt;?php echo ($_GET["mar"]);?&gt;" name="campera" &gt;Remeras&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="page.php?genid=&lt;?php echo $genid;?&gt;&amp;cat=camperas&amp;col=&lt;?php echo $col;?&gt;&amp;mar=&lt;?php echo $mar;?&gt;" name="campera"&gt;Camperas&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="page.php?genid=&lt;?php echo $genid;?&gt;&amp;cat=pantalones&amp;col=&lt;?php echo $col;?&gt;&amp;mar=&lt;?php echo $mar;?&gt;" name="pantalones"&gt;Pantalones&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="page.php?genid=&lt;?php echo $genid;?&gt;&amp;cat=shorts&amp;col=&lt;?php echo $col;?&gt;&amp;mar=&lt;?php echo $mar;?&gt;" name="short"&gt;Shorts&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="page.php?genid=&lt;?php echo $genid;?&gt;&amp;cat=vestidos&amp;col=&lt;?php echo $col;?&gt;&amp;mar=&lt;?php echo $mar;?&gt;" name="vestido"&gt;Vestidos&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>And I have my ifs looking like this: </p>
  
  <pre class="lang-html prettyprint-override"><code>
  &lt;?php   
  
  }elseif ( !empty($_GET["genid"]) &amp;&amp; !empty($_GET["cat"]) &amp;&amp; $datosArray[$i]["sex_id"] == $_GET["genid"] &amp;&amp; $datosArray[$i]["categoria"] == $_GET["cat"]){
  
  ?&gt;
  
  &lt;!-- Individual Product full Code --&gt;  
  ...
  &lt;!-- /Individual Product full Code --&gt;  
  
  &lt;?php   
  
      }elseif (!empty($_GET["genid"]) &amp;&amp; $datosArray[$i]["sex_id"] == $_GET["genid"]){
  ?&gt;
  
  &lt;!-- Individual Product full Code --&gt;  
   ... 
  &lt;!-- /Individual Product full Code --&gt; 
  
  &lt;?php 
      }} ?&gt; 
  </code></pre>
  
  <p>Right now the only "filter" it recognizes is the Gender one and its displaying all products even if the $_GET is set and displayed properly. </p>
  
  <p>Thank you all in advance.  </p>