hey everyone, I've got a pretty basic question about using $_SESSION in PHP.
here goes: a user enters their name and info and page1, and I want their information to display as "welcome user" on page 2.
It doesn't seem difficult at all, but when page 2 loads, the echo return nothing, they're blank.
Page 1:
Page 2:
It seems like the easiest thing in the world, HELP!
here goes: a user enters their name and info and page1, and I want their information to display as "welcome user" on page 2.
It doesn't seem difficult at all, but when page 2 loads, the echo return nothing, they're blank.
Page 1:
PHP:
<? session_start ();
$_SESSION['userFirstName'] = $first;
$_SESSION['userLastName'] = $last;
$_SESSION['userAddress'] = $address;
$_SESSION['userCity'] = $city;
$_SESSION['userState'] = $state;
include ('page2.php');
header('Refresh: 0;url=hyperlink to page 2');
?>
PHP:
<?php session_start ();
echo$_SESSION['userFirstName'];
echo$_SESSION['userLastName']; <br />
echo$_SESSION['userAddress']; <br />
echo$_SESSION['userCity'];
echo$_SESSION['userState']; ?>