Given a php form that submits to it’self,
via <?php echo $_SERVER[‘PHP_SELF’];?>
And the same form with some html and one submit button
<label for="submit">Submit</label>
<input id="submit" type="submit" value="Submit Info:" /><br />
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.
I know this starts a session:
<?php session_start() ?>
At the top of form.
And this destroys the session variables
session_destroy();
Would I have to do something like this:
$_SESSION[‘submit’] = ‘submit’;
I am trying to avoid creating sessions for each variable on my form, for example,
name
age
sex
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.