I have created a simple form which includes choosing a date & time. I would like the confirmation page to reiterate what date and time they chose.
My form gets processed by “signup.php” which then takes you to “confirmation.php”.
My problem is that all the data is showing not the one the was recently picked.
[SIZE=”5″]signup.php
[code=php]<?php
include(“config.php”);
$connection=mysql_connect($hostname,$user,$pass) or die (“Failed to connect.”);
mysql_select_db($dbname,$connection) or die (“Cannot connect to DB”);
$sql=”
insert into compensation
(userid, Name, Ext, Time)
values
(”, ‘$Name’, ‘$Ext’, ‘$Time’)
“;
$result=mysql_query($sql,$connection) or die (“Could not insert data into the DB.”);
if ($result)
{
header (“Location:confirmation.php”);
}
?>
[SIZE=”5″]confirmation.php
[code=php]<?php
include(“config.php”);
$connection=mysql_connect($hostname,$user,$pass) or die (“Failed to connect.”);
mysql_select_db($dbname,$connection) or die (“Cannot connect to DB”);
$userid=$_GET[‘userid’];
$sql = “SELECT * from compensation, compensation_times WHERE (compensation.Time = compensation_times.Time) “;
$result = mysql_query($sql);
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html>
<head>
</head>
<body>
<p class=”head” align=”center”><br /><br /><br /><br />Thank you for your submission.</p>
<p class=”textc”>Please Print this page so that you have a record of your Date and Time.</p>
<p class=”subhead”>Date & Time:</p>
<input type=”hidden” name=”userid” value=”<? echo $userid; ?>” />
<?php
while($row=mysql_fetch_assoc($result)){
?>
<p class=”head” align=”center”><? echo $row[‘Date’]; ?>
<?php
}
?>
<p class=”subhead” align=”center”>Please contact <a href=”mailto:[email protected]”>Lynn Blake</a> if you have any questions or concerns.</p>
</body>
</html>