I have a form that is supposed to store some of its data into a session. For the purpose of this example.
This information is then collected on another page.
<?php
session_start();
print_r($_SESSION['booking-form']); ########### for debugging purposes ###########
if ($_SESSION['booking-form']) {
echo $_POST['GT_title']
?>
<!DOCTYPE html>
<html>
<?php
}
elseif ($_SESSION['booking-form']) {
}?>
</html>
Now although the debug is working the echo is not working ie. echo S_POST[‘GT_title’].
- How do I echo the information on the second page.
- Can I echo it wherever I want it in the html (ie. in the middle of the body somewhere with
- On the first page some data in the form can be changed with options. This would need to update the session before the page is changed.
CLARIFICATION
For the purpose of a booking form. The user filled in a series of options that were then echo’d on the next page. At this point they need to log in so the form data must enter into a session. The session data should then be returned on a third page.
1) what information?
$_POST['GT_title']would refer to a form element, presumably on the previous page. Does it exist? Is it filled in? what are you expecting?2) You can
echowhere ever you like.3) clarify? you can update a session with post values easily.
$_SESSION['foo'] = $_POST['bar']your question isn’t really that clear.