Page 1 of 1

accessing form variables

Posted: Tue Aug 05, 2003 12:28 am
by greeneel
I have a page created with a form in itwith the following script:

<html>
<head>
<title>Hazels Garage</title>
</head>
<body>
<h1>Hazels Garage</h1>
<h2>Order Form</h2>
</html>
<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="tyreqty" size=3 maxlength=3></td>
</tr>
<tr>
<td>Oil</td>
<td align=center><input type="text" name="oilqty" size=3 maxlength=3></td>
</tr>
<tr>
<td>Spark Plugs</td>
<td align=center><input type="text" name="sparkqty" size=3 maxlength=3></td>
</tr>
<tr>
<td colspan=2 align=center><input type=submit value="Submit Order"></td>
</tr>
</table>
</form>
-------------------------------------------------------------------------------
now the page processorder.php was created with the following script:

<html>
<head>
<title>Hazels garage</title>
</head>
<body>
<h1>Hazels Garage</h1>
<h2>Order Results</h2>
<?
echo "<p>Order processed.";
echo date("H:i, jS F");
echo "<br>";
echo "<p>Your order is as follows:";
echo "<br>";
echo $tireqty." tires<br>";
echo $oilqty." bottles of oil<br>";
echo $sparkqty." spark plugs<br>";
?>
</body>
</html>

my problems is that when values are placed in the tire, oil, or sparkplug fields theu is no indication of this when the page in loaded this is what i get;

Hazels Garage
Order Results
Order processed.01:24, 5th August


Your order is as follows:
tires
bottles of oil
spark plugs

Posted: Tue Aug 05, 2003 9:23 am
by daven
viewtopic.php?t=511

Read that thread