help with a very basic script
Posted: Mon Sep 02, 2002 1:14 pm
ok I has some programming experience, I just bought a PHP/mySQL book and in the very first example I'm gettig a problem. It could be a setting because all the examples in the book are on cd and I get the same error
Notice: Undefined variable: tireqty in c:\program files\apache group\apache\htdocs\chapter1\processorder.php on line 14
tires
I get this for my three variables past from an html form. Heres the code for the HTML form.
<html>
<head>
<title>Dave's Auto Parts</title>
</head>
<body>
<h1>Dave's Auto Parts</h1>
<h2>Order Form</h2>
<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>Tires</td>
<td align="center"><input type="text" name="tireqty" 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>
</body>
</html>
Here is the code for the PHP script
<html>
<head>
<title>Dave's Auto Parts - Order Results</title>
</head>
<body>
<h1>Dave's Auto Parts</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>
I'm using Apache and Windows 2000 any suggestions???
Notice: Undefined variable: tireqty in c:\program files\apache group\apache\htdocs\chapter1\processorder.php on line 14
tires
I get this for my three variables past from an html form. Heres the code for the HTML form.
<html>
<head>
<title>Dave's Auto Parts</title>
</head>
<body>
<h1>Dave's Auto Parts</h1>
<h2>Order Form</h2>
<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>Tires</td>
<td align="center"><input type="text" name="tireqty" 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>
</body>
</html>
Here is the code for the PHP script
<html>
<head>
<title>Dave's Auto Parts - Order Results</title>
</head>
<body>
<h1>Dave's Auto Parts</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>
I'm using Apache and Windows 2000 any suggestions???