Here is the code that handles the form information
Code: Select all
<?php
include 'eu_home.php';
?>
<!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<head>
<title>Demo Multiple drop down list box from plus2net</title>
</head>
<body>
<?php
$pickup=$_POST['pickup'];
$cat=$_POST['cat'];
$subcat=$_POST['subcat'];
$load=$_POST['load'];
$appointment_date = sprintf('%02d-%02d-%04d',$_POST['day'], $_POST['month'], $_POST['year']); //mm-dd-yyyy
echo "Date required $appointment_date"."<BR>";
echo "Picking up from $pickup" ."<BR>";
echo "Going to $subcat"."<BR>";
$result = mysql_query("SELECT full_price, half_price, luton FROM eu_place WHERE city = '" . mysql_real_escape_string($subcat) . "'") or die(mysql_error());
$row = mysql_fetch_array($result);
switch($load) {
case 'full_load' :
$total = $row['full_price'];
break;
case 'half_load' :
$total = $row['half_price'];
break;
case 'luton':
$total = $row['luton'];
break;
}
$rResult = mysql_query("SELECT price FROM uk_place WHERE city = '" . mysql_real_escape_string($pickup) . "'") or die(mysql_error());
while ($aRow = mysql_fetch_array($rResult, MYSQL_ASSOC))
{
$iPrice = $aRow['price'];
echo "£";
echo ($iPrice) + ($total)."<BR>";
}
echo "<form method=post name=f2 action='confirm.php'>";
echo 'To confirm the above details, please enter your details below and click submit' . "<br />";
echo 'Full Name' . "<input type='text' name='name' id='name'/>" . "<br />";
echo 'Telephone Number' . "<input type='text' name='telephone' id='telephone'/>" . "<br />";
echo 'Email' . "<input type='text' name='email' id='email'/>" . "<br />";
echo 'Comments:' ."<textarea id='textareainput' name='textareainput' rows='10' cols='22'></textarea>";
echo "<input type='hidden' name='date' id='date' value='$appointment_date'/>";
echo "<input type='hidden' name='pickUpPoint' id='pickUpPoint' value='$pickup'/>";
echo "<input type='hidden' name='destination' id='destination' value='$subcat'/>";
echo "<input type='hidden' name='loadType' id='loadType' value='$load'/>";
echo "<input type='hidden' name='price' id='price' value='($iPrice) + ($total)'/>" . "<br />";
echo "<input type=submit value=Confirm>";
?>
</div>
</body>
</html>