title: php sessions create and destroy on submit?
body: <p>Given a php form that submits to it’self, 
  via <code>&lt;?php echo $_SERVER[‘PHP_SELF’];?&gt;</code></p>
  
  <p>And the same form with some html and one submit button</p>
  
  <pre><code>&lt;label for="submit"&gt;Submit&lt;/label&gt;
  &lt;input id="submit" type="submit" value="Submit Info:" /&gt;&lt;br /&gt;
  </code></pre>
  
  <p>How do I set it up, such that when the user has finished inputting all the relevant
  information on the form(one, form.php), without any errors, the session is destroyed, after pressing
  the submit button.</p>
  
  <p>I know this starts a session:</p>
  
  <pre><code>&lt;?php session_start() ?&gt;
  </code></pre>
  
  <p>At the top of form.</p>
  
  <p>And this destroys  the session variables </p>
  
  <pre><code>session_destroy();
  </code></pre>
  
  <p>Would I have to do something like this:</p>
  
  <pre><code>$_SESSION[‘submit’] = ‘submit’;
  </code></pre>
  
  <p>I am trying to avoid creating sessions for each variable  on my form, for
  example, </p>
  
  <p>name</p>
  
  <p>age</p>
  
  <p>sex</p>
  
  <p>It sounds like it would be a lot of work to create sessions for each and every
  variable on a given form, that’s why I am here seeking answers, in the meantime
  I will read more on sessions, thank you for not flaming the newb.</p>