title: How to get javascript array from URL with $_GET
body: <p>I have checkboxes that are passed as an array to URL and on page reload I should get them back so that what is checked is remembered.</p>
  
  <p>here is my javascript, array in question is 'entry_reason':</p>
  
  <pre><code>&lt;script language="JavaScript"&gt;
  &lt;!--
  function reload(nname, surname, birth_date, birth_country, birth_place, postal_code, address, residence, oib, license_number, license_iplace, passport_number, passport_iplace, entry_reason, myself, myselfeng)
  
  {
  // Setting the variable with the value of selected country's ID
  var nname=document.getElementById('nname').value;
  var surname=document.getElementById('surname').value;
  var birth_date=document.getElementById('birth_date').value;
  var c=document.getElementById('birth_country').value;
  var city=document.getElementById('birth_place').value;
  var postal_code=document.getElementById('postal_code').value;
  var address=document.getElementById('address').value;
  var residence=document.getElementById('residence').value;
  var oib=document.getElementById('oib').value;
  var license_number=document.getElementById('license_number').value;
  var license_iplace=document.getElementById('license_iplace').value;
  var passport_number=document.getElementById('passport_number').value;
  var passport_iplace=document.getElementById('passport_iplace').value;
  var entry_reason=[document.getElementById('entry_reason1').value, document.getElementById('entry_reason2').value, document.getElementById('entry_reason3').value, document.getElementById('entry_reason4').value, document.getElementById('entry_reason5').value, document.getElementById('entry_reason6').value, document.getElementById('entry_reason7').value];
  var myself=document.getElementById('myself').value;
  var myselfeng=document.getElementById('myselfeng').value;
  // Sending the country id in the query string to retrieve the city list
  self.location='blacklistprivateregister.php?nname=' + nname + '&amp;surname=' + surname + '&amp;birth_date=' + birth_date + '&amp;birth_country=' + c + '&amp;birth_place=' + city + '&amp;postal_code=' + postal_code + '&amp;address=' + address + '&amp;residence=' + residence + '&amp;oib=' + oib + '&amp;license_number=' + license_number + '&amp;license_iplace=' + license_iplace + '&amp;passport_number=' + passport_number + '&amp;passport_iplace=' + passport_iplace + '&amp;entry_reason[]=' + entry_reason + '&amp;myself=' + myself + '&amp;myselfeng=' + myselfeng;
  }
  --&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>I get URL that looks something like this:</p>
  
  <pre><code>http://xxxxxxxx.php?nname=ivo&amp;surname=&amp;birth_date=2012-11-08&amp;birth_country=Algeria&amp;birth_place=Benguela&amp;postal_code=10000&amp;address=%C4%8Ci%C4%8Dkovina%20222&amp;residence=Zagorne&amp;oib=1231231232131&amp;license_number=21312323213&amp;license_iplace=Zagreb&amp;passport_number=000493243244&amp;passport_iplace=Vara%C5%BEdin&amp;entry_reason[]=1,2,3,4,5,6,7&amp;myself=aasddsad&amp;myselfeng=asdadasd
  </code></pre>
  
  <p>Place with my input checkboxes is like this:</p>
  
  <pre><code>&lt;legend&gt;&lt;?php echo REASONFORENTRY_R; ?&gt;&lt;/legend&gt;
          &lt;?php 
              $e=array();
              if(isset($_POST['entry_reason'])){ $e=$_POST['entry_reason'];} 
              if($_GET['entry_reason']) {$e=$_GET['entry_reason'];} 
          ?&gt;
          &lt;p&gt;&lt;input type="checkbox" name="entry_reason[]" id="entry_reason1" class="check" value="1"  &lt;?php if(in_array('1', $e)) echo 'checked="checked" '; ?&gt;/&gt;&lt;?php echo ER1_R; ?&gt;&lt;/p&gt;
           &lt;p&gt;&lt;input type="checkbox" name="entry_reason[]" id="entry_reason2" class="check"  value="2"  &lt;?php if(in_array('2', $e)) echo 'checked="checked" '; ?&gt;/&gt;&lt;?php echo ER2_R; ?&gt;&lt;/p&gt;
           &lt;p&gt;&lt;input type="checkbox" name="entry_reason[]" id="entry_reason3" class="check"  value="3"  &lt;?php if(in_array('3', $e)) echo 'checked="checked" '; ?&gt;/&gt;&lt;?php echo ER3_R; ?&gt;&lt;/p&gt;
           &lt;p&gt;&lt;input type="checkbox" name="entry_reason[]" id="entry_reason4" class="check"  value="4"   &lt;?php if(in_array('4', $e)) echo 'checked="checked" '; ?&gt;/&gt;&lt;?php echo ER4_R; ?&gt;&lt;/p&gt;
           &lt;p&gt;&lt;input type="checkbox" name="entry_reason[]" id="entry_reason5" class="check"  value="5"   &lt;?php if(in_array('5', $e)) echo 'checked="checked" '; ?&gt;/&gt;&lt;?php echo ER5_R; ?&gt;&lt;/p&gt;
           &lt;p&gt;&lt;input type="checkbox" name="entry_reason[]" id="entry_reason6" class="check"  value="6"  &lt;?php if(in_array('6', $e)) echo 'checked="checked" '; ?&gt;/&gt;&lt;?php echo ER6_R; ?&gt;&lt;/p&gt;
           &lt;p&gt;&lt;input type="checkbox" name="entry_reason[]" id="entry_reason7"  class="check" value="7"  &lt;?php if(in_array('7', $e)) echo 'checked="checked" '; ?&gt;/&gt;&lt;?php echo ER7_R; ?&gt;&lt;/p&gt;
  </code></pre>
  
  <p>I have 3 actions on site and for 2 of them I want checkboxes to be remembered:
  1) Page reload on javascript function reload
  2) Page reload on submit with error - this one works for now with $_POST</p>
  
  <p>I presume that for 1st reload I should get all variable items from URL into $_GET and pass them on to $e variable but it doesn't seem to be working.</p>
  
  <p>All help is appreciated!</p>