A beginner with php needs help
Posted: Mon Oct 27, 2003 9:29 am
Hi, i am a beginner when it comes to php, I am having great difficulties doing one specific thing in php and that is.......accessing form variables and i cant do it!!!
I have two files, 1 HTML file and 1 php file, when i call up the HTML file it allows me to input information, and this information that i input should be put into an array and outputted on the processorder.php screen - however it doesnt - all i get is the headings on the page but no results - can anyone help me with this?????i am just finding it confusing as to why it doesnt work?
This is the HTML file
This is the PHP file;
[mod_edit:
I have two files, 1 HTML file and 1 php file, when i call up the HTML file it allows me to input information, and this information that i input should be put into an array and outputted on the processorder.php screen - however it doesnt - all i get is the headings on the page but no results - can anyone help me with this?????i am just finding it confusing as to why it doesnt work?
This is the HTML file
Code: Select all
<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>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>This is the PHP file;
Code: Select all
<html>
<head>
<title> Bob's Auto Parts - Order Results</title>
</head>
<body>
<h1>Bob's Auto Parts</h1>
<h2>
Order Results
<?
echo "<p>Order processed at ";//this displays the date
echo date("H:i, jS F");
echo "<br>";
echo"<p>Your order is as follows:";
echo"<br>";
$HTTP_POST_VARS["tireqty"];
$HTTP_POST_VARS["oilqty"];
$HTTP_POST_VARS["sparkqty"];
?>
</h2>
</body>
</html>Code: Select all
andCode: Select all
tags added][/size]