accessing form variables

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
greeneel
Forum Commoner
Posts: 47
Joined: Wed Jul 30, 2003 5:19 pm

accessing form variables

Post 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
User avatar
daven
Forum Contributor
Posts: 332
Joined: Tue Dec 17, 2002 1:29 pm
Location: Gaithersburg, MD
Contact:

Post by daven »

viewtopic.php?t=511

Read that thread
Post Reply