Thank you Peter.
Ok I am still lost. I have this code successfully working in a page:
<html>
<head><title>Bob’s Auto Parts</title></head>
<body>
<form action=”processorder.php” method=”post”>
<table border=”0″>
<tr bgcolor=”#cccccc”>
<td width=”150″>Item</td>
<td width=”15″>Quantity</td>
</tr>
<tr>
<td>Tyres</td>
<td align=”center”><input type=”text” name=”tireqty” size=”3″ />
</td>
</tr>
<tr>
<td>Oil</td>
<td align=”center”><input type=”text” name=”oilqty” size=”3″ />
</td>
</tr>
<tr>
<td>Spark Plugs</td>
<td align=”center”><input type=”text” name=”sparkqty” size=”3″/>
</td>
</tr>
<tr>
<td>How did you find Bob’s?</td>
<td><select name=”find”>
<option value = “a”>I’m a regular customer</option>
<option value = “b”>TV advertising</option>
<option value = “c”>Phone directory</option>
<option value = “d”>Word of mouth</option>
</select>
</td>
</tr>
<tr>
<td colspan=”2″ align=”center”><input type=”submit” value=”Submit Order” /></td>
</tr>
</table>
</form>
</body>
</html>
I need to know about the next piece of code, which is the “processorder.php”,as to where I put it. Do I put it somewhere with the file manager or do I put it as part of the theme similar to the php for sidebars? You are suggesting that I put the two together which I tried without success.
<html>
<head>
<title>Bob’s Auto Parts – Order Results</title>
</head>
<body>
<h1>Bob’s Auto Parts</h1>
<h2>Order Results</h2>
<?php
echo ‘<p>Order processed at ‘;
echo date(‘H:i, jS F’);
echo ‘</p>’;
echo ‘<p>Your order is as follows: </p>’;
echo $tireqty.’ tires
‘;
echo $oilqty.’ bottles of oil
‘;
echo $sparkqty.’ spark plugs
‘;
$totalqty = 0;
$totalamount = 0.00;
$totalqty = 0;
$totalqty = $tireqty + $oilqty + $sparkqty;
echo ‘Items ordered: ‘.$totalqty.’
‘;
$totalamount = 0.00;
define(‘TIREPRICE’, 100);
define(‘OILPRICE’, 10);
define(‘SPARKPRICE’, 4);
$totalamount = $tireqty * TIREPRICE
+ $oilqty * OILPRICE
+ $sparkqty * SPARKPRICE;
echo ‘Subtotal: $’.number_format($totalamount,2).’
‘;
$taxrate = 0.10; // local sales tax is 10%
$totalamount = $totalamount * (1 + $taxrate);
echo ‘Total including tax: $’.number_format($totalamount,2).’
‘;
?>
</body>
</html>
If I could get this going then I could work through my book on PHP, MuySQL using WP without having to set up some complicated testbed.
Thank you in advance for your help.