title: how to pass multiple variables using self.location
body: <p>i cant pass and get variables using  self.location on  reload function when choosing dropdown value.</p>
  
  <p>i got only the first value that i passed through url,how to pass the value from the second dropdown through this samr url dd-mysqli.php</p>
  
  <pre><code>@$cat=$_GET['cat']; 
  @$subcat=$_GET['subcat'];// Use this line or below line if register_global is off
  if(strlen($cat) &gt; 0 and !is_numeric($cat)){ // to check if $cat is numeric data or not. 
  echo "Data Error";
  exit;
  }
  
  ?&gt;
  &lt;?php
  if(isset($_POST['submit'])){
  $cat=$_POST['cat'];
  $subcat=$_POST['subcat'];
  
  echo "Value of \$cat = $cat &lt;br&gt;Value of \$subcat = $subcat ";}
  ?&gt;
  
  
  &lt;html&gt;
  
  &lt;head&gt;
  &lt;title&gt;Multiple drop down list box from plus2net&lt;/title&gt;
  &lt;SCRIPT language=JavaScript&gt;
  &lt;!--
  function reload(form)
  {
  var val=form.cat.options[form.cat.options.selectedIndex].value;
      var val2=form.subcat.options[form.subcat.options.selectedIndex].value;
  
  
      self.location='dd-mysqli.php?cat=' + val + '&amp;subcat=' + val2;
  }
  //--&gt;
  
  &lt;/script&gt;
  
    echo "&lt;form method=post name=f1 action='dd-mysqli.php'&gt;";
  //////////        Starting of first drop downlist /////////
  echo "&lt;select name='cat' onchange=\"reload(this.form)\"&gt;&lt;option value=''&gt;Select one&lt;/option&gt;";
  if($stmt = $connection-&gt;query("$query2")){
      while ($row2 = $stmt-&gt;fetch_assoc()) {
      if($row2['id']==@$cat){echo "&lt;option selected value='$row2[id]'&gt;$row2[category_description]&lt;/option&gt;";}
  else{echo  "&lt;option value='$row2[id]'&gt;$row2[category_description]&lt;/option&gt;";}
  
    }
  }else{
  echo $connection-&gt;error;
  }
  
  echo "&lt;/select&gt;";
  //////////////////  This will end the first drop down list ///////////
  echo "&lt;select name='subcat'  onchange=\"reload(this.form)\"&gt;&lt;option value=''&gt;Select one&lt;/option&gt;";
  if(isset($cat) and strlen($cat) &gt; 0){
  if($stmt = $connection-&gt;prepare("SELECT * FROM category AS c INNER JOIN category_language AS cl ON c.id=cl.category_id where parent_id=? &amp;&amp; lang_id='1' ORDER BY category_description")){
  $stmt-&gt;bind_param('i',$cat);
  $stmt-&gt;execute();
   $result = $stmt-&gt;get_result();
   while ($row1 = $result-&gt;fetch_assoc()) {
       if($row1['id']==@subcat){echo "&lt;option selected value='$row1[id]'&gt;$row1[category_description]&lt;/option&gt;";}
   else{echo  "&lt;option value='$row1[id]'&gt;$row1[category_description]&lt;/option&gt;";}
  
    }
  
  }
  </code></pre>
  
  <p>how can i solve this </p>