I have created a form on page one. I want it to populate pages two and three with the customer name, address, province and phone number from the form by way of a session.
Getting the name, etc. from page one to two is easy (I know it's not because of the session though) however, I get the customer name to appear on page three but the address, province and phone number won't flow through.
I have tried several combinations but I am now stumped. Any help is appreciated:
Code Page One
<?
session_start();
$name = isset($_SESSION['customer_name'])
? $_SESSION['customer_name']
: "Anonymous";
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>PAGE ONE</title>
</head>
<body>
<form action="two.php" method="post" name="preview" id="preview" input type="text">
Customer Name:
<p>
<input name="customer_name" type="text" size="15" />
</p>
<p>
<input name="customer_address" type="text" size="15" />
</p>
<p>
<input name="customer_province" type="text" size="15" />
</p>
<p>
<input name="customer_phone" type="text" size="15" />
</p>
<p>
<input name="action" type="submit" value="Preview Site!" />
</p>
</form>
</body>
</html>
Code Page Two
<?
session_start();
$_SESSION['customer_name'] = isset($_POST['customer_name'])
? $_POST['customer_name']
: "Anonymous";
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>PAGE TWO</title>
</head>
<body>
<p>
I want the customer name to appear on this page<br>
due to it being entered on the first page
</p>
<?
echo $_SESSION['customer_name']
?>
<p>
<?
$Name = $_POST['customer_address'];
echo $customer_address
?>
</p>
<p>
<?
$Name = $_POST['customer_province'];
echo $customer_province
?>
</p>
<p>
<?
$Name = $_POST['customer_phone'];
echo $customer_phone
?>
</p>
<p>
That's easy
</p>
<p>
<a href="three.php">Click here to go to Page Three</a>
</p>
</body>
</html>
Code Page Three
<?
session_start();
if (!isset($_SESSION['customer_name'])):
$_SESSION['customer_name'] = "Anonymous";
endif;?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>PAGE THREE</title>
</head>
<body>
<p>
I want the customer name to appear on this page as well <br>
due to it being entered on the first page
</p>
<?
echo $_SESSION['customer_name']
?>
<p>
<?
echo $_SESSION['customer_address'];
?>
</p>
<p>
<?
echo $_SESSION['customer_province'];
?>
</p>
<p>
<?
echo $_SESSION['customer_phone'];
?>
</p>
</p>
</body>
</html>
Thanks