Truthfully, I haven't got a clue when it comes to PHP, but I can see the power of it, I just want to learn how to control it. I've got a three page booking form. Pages one to two are working, but two to three isn't working. Here's the PHP code from page two -
<?php
// Total Number of Nights Between Picked Dates
$days = (strtotime($_POST["checkoutdate"]) - strtotime($_POST["checkindate"])) / 86400 - 1;
// Extra Nightly Cost
define ("extranights", 80);
$addnights = (int)extranights * ($days - 4);
// Deposit Price Calculation
define("deposit", 370);
$deposit = null;
if (isset($_POST["numberofpeople"])) {
$numberofpeople = intval($_POST["numberofpeople"]);
$deposit = ((int)deposit * $numberofpeople + $addnights) * 0.3;
}
// Total Price Calculation
define("totalprice", 370);
$result = null;
if (isset($_POST["numberofpeople"])) {
$numberofpeople = intval($_POST["numberofpeople"]);
$result = (int)totalprice * $numberofpeople + $addnights;
}
?>
Then I've echoed the values of deposit and totalprice on the same page
<table>
<tr>
<td width="573" height="30" align="right" valign="bottom" style="color:#0099FF;">( confirm reservation ) 30% Deposit :</td>
<td width="158" align="left" valign="bottom" style="color:#0099FF; font-size:1.8em; line-height:23px;">€<?php echo $deposit; ?></td>
</tr>
<tr>
<td height="30" align="right" valign="bottom" style="color:#0099FF;">Total Price :</td>
<td align="left" valign="bottom" style="color:#0099FF; font-size:1.8em; line-height:23px;">€<?php echo $result; ?></td>
</tr>
<td width="131" align="right" valign="middle" style="color:#000;"><input type="submit" name="submit" id="formbtn" value="CONTINUE" /></td>
</table>
What I've been agonising over is how to post the echoed values of deposit and totalprice on to a third page. If the solution/answer is extensive then I'll have to go back to the drawing board and start again, bit by bit. But this would finish the user side of the form. I'm not looking forward to the database stuff :(