title: Passing Variables Through Javascript's location.reload(true)
body: <p>I have a webpage with a really large MySQL query as the result. The query is changed depending on the user, so it will be different for each person. I am trying to provide a method of resorting the query by making the headers into clickable links.</p>
  
  <p>My query results page is written in PHP and HTML for the most part.</p>
  
  <p>For each column header, I have the following:</p>
  
  <pre><code>echo "&lt;th id='frame_data_table'&gt;
      &lt;a href='javascript:location.reload(true)'&gt;XBox 360 Command&lt;/a&gt;
  &lt;/th&gt;";
  </code></pre>
  
  <p>On clicking the column header link, the page will reload using the javascript in the a href. This is the most successful way I've been able to get my webpage to reload with all of the query information.</p>
  
  <p>All I need to do now is figure out how to pass another variable upon clicking the header link. I have tried to do syntactical variations of something like</p>
  
  <pre><code>echo "&lt;th id='frame_data_table'&gt;
      &lt;a href='javascript:location.reload(true)+?var1=command_column'&gt;XBox 360 Command&lt;/a&gt;
  &lt;/th&gt;";
  </code></pre>
  
  <p>with no success. Once I get the variable to pass, I will just grab it with $_GET[''], no problem.</p>
  
  <p>Any advice? It's worth noting that after extensive googling, I saw a lot of <code>location.href</code>. This does not reload my page, and in fact all it really does (in Chrome, anyway) is load a page with just the text url of the page I want.</p>
  
  <p>Is there any way to pass a variable in the url using javascript's location.reload()? Thanks in advance.</p>
  
  <p>-Anthony</p>
  
  <p><b>UPDATE: Solution</b></p>
  
  <p>I asked a similar question and was able to obtain a solution. See the link <a href="https://stackoverflow.com/q/28396518/2664815">here</a>. The solution is fully explained in the bottom of the question.</p>