moondance
05-30-2003, 01:31 PM
i've just started to learn php. I installed apache, php and mySQL so they work offline.
I've been teaching myself from this book. Problem is, i've copied a tutorial from the book, word for word, and its not giving the same response thats in the book.
I know apache, and mysql work fine. PHP works also, as the date and time are displayed dynamically, yet the other values aren't.
Can someone have a try on their computer and tell me if i've configured php wrong or if theres an error in my code.
ta ;)
Heres the html page:
<html>
<head>
</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="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>
</body>
</html>
and heres the php file:
<html>
<head>
<title> Your Order</title>
</head>
<body>
<h1>Maxwells Motor Parts</h1>
<h2>Your Order Inventory:</h2>
<?
echo "<p>Order processed at " ;
echo date("H:i, jS F");
echo "<br>";
echo "Your order is as follows" ;
echo "<br>";
echo $TyreQty. " tyres<br>";
echo $OilQty. " cans of oil<br>";
echo $SparkQty. " spark plugs<br>";
</body>
</html>
I've been teaching myself from this book. Problem is, i've copied a tutorial from the book, word for word, and its not giving the same response thats in the book.
I know apache, and mysql work fine. PHP works also, as the date and time are displayed dynamically, yet the other values aren't.
Can someone have a try on their computer and tell me if i've configured php wrong or if theres an error in my code.
ta ;)
Heres the html page:
<html>
<head>
</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="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>
</body>
</html>
and heres the php file:
<html>
<head>
<title> Your Order</title>
</head>
<body>
<h1>Maxwells Motor Parts</h1>
<h2>Your Order Inventory:</h2>
<?
echo "<p>Order processed at " ;
echo date("H:i, jS F");
echo "<br>";
echo "Your order is as follows" ;
echo "<br>";
echo $TyreQty. " tyres<br>";
echo $OilQty. " cans of oil<br>";
echo $SparkQty. " spark plugs<br>";
</body>
</html>