title: Using a form (method=GET) to pass parameters defined elsewhere
body: <p>This is such a simple question that I'm afraid I'm missing something basic, so feel free to shame me, but I'm stumped. </p>
  
  <p>My goal: make a "continue" button that reloads the same page, but with an incremented ?Page= parameter that's visible to GET. </p>
  
  <p>My current approach: define the new URL that should be loaded (this bit works)</p>
  
  <pre><code>$_SESSION['NextPage'] = $_SESSION['Page']+1; 
  $_SESSION['NewURL'] = $_SESSION['CurrentFile'] . '?Page=' . $_SESSION['NextPage'];
  // N.B: $_SESSION['CurrentFile'] just specifies the URL of the current page.
  // Note also that there should ALWAYS be a ?Page= parameter in the URL, even if it evaluates to NaN or something weird.
  </code></pre>
  
  <p>Then, later on, a function is called that runs this code and creates a submit button.  The button is there, as expected, but it doesn't WORK as expected: code &amp; details below.</p>
  
  <pre><code>echo "&lt;tr&gt;&lt;td&gt;&lt;form action='" . $_SESSION['NewURL'] . "' method='GET'&gt; &lt;input type='submit' value='Continue'&gt;&lt;/form&gt; &lt;/td&gt;&lt;/tr&gt;";
  </code></pre>
  
  <p>The problem: When the form submits, it doesn't append any <code>?Page=</code> parameters to the URL, either in Chrome or Safari.  Is this because the Page parameter isn't specified inside this form??  If so, there must be a way around that, right?  <code>$_SESSION['NextPage']</code> is a session variable, for crying out loud!  Not to mention that when I echo <code>$_SESSION['NewURL']</code> inside the function, the info is accessible there, <code>?Page=2</code> and all. It's just not pushed to the URL. Unfortunately, the page is set up to display different content based on the value of <code>$_GET['Page']</code>, and now there's nothing there to control that process. </p>
  
  <p>If I've just made a syntax error or something I'll be embarrassed but relieved. I just can't find it, and don't know where else to turn. Thanks!</p>