Jump to content

Recommended Posts

I have a multipage form from which people are selecting different things (which are then sent via POST then stored as a SESSION) from each page. I would like to add in between each a script that will let them confirm that they chose what they wanted, before they go on to the next choice. If not, then they can go back.

What I'm not sure about is what to do with the SESSION? Do I need to destroy it? Or will it get overwritten?

Here is the basic code I have now:

<?php

session_start();
$_SESSION['align'] = $_POST['align'];
if ( isset ( $_SESSION['align'] )) {
print "<p>You have selected " . $_SESSION['align'] ." for your Characters Alignment.</p>";
} else {
print print '<p>Please go back and select an Alignment for your Character!</p>';
exit;
}

?>

<table>
<tr>
<td>If you are sure sure about your Alignment choice, continue to the next page. Otherwise select the 'Back' button.
</td>
</tr>
<tr>
<td><form><input type="button" name="align_back" value="BACK" onClick="history.go(-1);return true;"></form>
</td>
<td><form method="post" action="char_breed.php"><input type="submit" name="align_confirm" value="NEXT"></form>
</td>
</tr>
</table>

Thanks for any help or suggestions.
Link to comment
https://forums.phpfreaks.com/topic/8864-form-confirmation-seesion-destroy/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.