okay, I just don't know what to do to get this thing to work. I don't really understand the whole session thing. This is part of what I'm trying to do with them
Form2.php
<?php
if (isset($_POST['submit2']))
{
if (!$_POST['cust_address'])
{
$x = FALSE;
$message[] = "You must enter your Address";
}else{
$x = TRUE;
}
if($_POST['cust_phone'])
{
$y = TRUE;
}else{
$y = FALSE;
$message[] = "Phone # required";
}
}
?>
<?php
if ($x and $y){
header("Location: [url]http://www.whatnott.com/final.php[/url]");
exit;
}
?>
<?php
session_start();
session_register("cust_address");
session_register("cust_phone");
?>
<HTML>
<HEAD>
<TITLE>Multi-page Form - Page Two</TITLE>
</HEAD>
<BODY>
<p>Please fill in the following information</p>
<?php
if ($message) {//if there is any error message, print it to the screen
echo "<table width=550 align=\"left\" div align=\"center\"><br /><font color=red><b>The following problems occurred:</b><br /></font><font color=red size=3>\n";
foreach ($message as $key => $value) {
echo "$value <br />\n";
}
}
?>
<FORM METHOD="POST" ACTION="form2.php">
Address: <INPUT TYPE="text" SIZE="50" name="cust_address" value="<?php echo $_POST['cust_address']; ?>"><BR>
Phone: <INPUT TYPE="text" SIZE="20" name="cust_phone" value="<?php echo $_POST['cust_phone']; ?>"><BR>
<INPUT TYPE="submit" name="submit2" value="Proceed">
</FORM>
</BODY>
</HTML>
final.php
<?php
session_start();
?>
<HTML>
<HEAD>
<TITLE>Multi-page Form - Final</TITLE>
</HEAD>
<BODY>
<p>You filled in:</p>
Name: <?php print $SESSION['cust_name']; ?><BR>
Email: <?php print $SESSION['cust_email']; ?><BR>
Address: <?php print $SESSION['cust_address'];; ?><BR>
Phone: <?php print $SESSION['cust_phone'];; ?><BR>
</BODY>
</HTML>
What all do I have wrong? I'm sure it is alot. On the final.php page I also tried using <?php echo $POST['cust_name'] ?>; and <?php echo $SESSION['cust_name'] ?>;
Of course when I tried using <?php echo $SESSION['cust_name'] ?>; I had this on the form2.php page: $SESSION['cust_name'] = $_POST['cust_name'];
Nothing has worked.