title: Variable Value lost after pressing the "submit" button in PHP
body: <p>When Page_B is first run (by clicking the submit button on another page, Page_A) the value of variable SG (which is sent over from Page_A) is nicely printed. However, when I click the submit button on Page_B (which, correct me if I'm wrong, runs Page_B again), the printing space becomes empty. I conclude that the content (value) of SG has been DELETED as a result of the submit action. That is not what I want, as this value is needed  furtheron Page_B (code not yet written). How can I avoid this deleting from happening?</p>
  
  <p><strong>Here is the code of Page_B:</strong></p>
  
  <pre><code>&lt;html&gt;
  
  &lt;?php
  
  $SG=$_POST['SG'];
  print ($SG);
  
  ?&gt;
  
  &lt;form action="Page_B.php" method="POST"&gt;
  
  &lt;input type="text" name="trekking"&gt;
  &lt;input type="submit"&gt;
  
  &lt;/form&gt;
  
  &lt;?php
  
  $T=$_POST['trekking'];
  print ($T);
  
  ?&gt;
  
  
  &lt;/html&gt;
  </code></pre>