title: PHP - storing variable values upon a link click, and keeping the value the same as user navigates
body: <p>I have a situation where URL's need to carry variable values to another page.</p>
  
  <p>Sometimes the URL will only need to carry one variable value, like here:</p>
  
  <pre><code>&lt;a href="test2.php?occupation=&lt;?php echo $Occupation; ?&gt;"&gt;Anchor Text&lt;/a&gt;
  </code></pre>
  
  <p>Or it may need to carry multiple variable values, like here.</p>
  
  <pre><code>&lt;a href="test2.php?occupation=&lt;?php echo $Occupation; ?&gt;&amp;firstName=&lt;?php echo $FirstName; ?&gt;&amp;lastName=&lt;?php echo $LastName; ?&gt;"&gt;Anchor Text&lt;/a&gt;
  </code></pre>
  
  <p>The amount of variable values the URL carrys depends on how many variables receive a value from the GET statements on the page. If the GET statements are empty, then there is no need to carry the value to the next page in the link.</p>
  
  <pre><code>$FirstName = $_GET["firstName"];
  $LastName = $_GET["lastName"];
  $Occupation = $_GET["occupation"];
  </code></pre>
  
  <p>I want to avoid putting more variables in the URL than are needed. But to make sure all variables get carried, I would have to use the second link above which contains all the possible variables (in case all variables are NOT empty). </p>
  
  <p>So here's my question: is there a way to store a value into a variable upon the click of a link, and then keep the same value in the variable as the user navigates through pages, without having to put that variable value in every link the user clicks on? I know SESSIONS will work, but disabling cookies will cause some issues. I want to be safe from any client side issues.</p>