I am new to Php so i basically dont know much just started studying from a book php and mysql doing the same as the book said but my code doesnt fetch the data if i use Post method but does work if i use Get method. the book has used post so kind of confused here :/ this is the html part:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</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>
And the php code is this
<html>
<?php
// create short variable names
$tireqty = $_POST['tireqty'];
$oilqty = $_POST['oilqty'];
$sparkqty = $_POST['sparkqty'];
?>
<head>
<title>Bob’s Auto Parts - Order Results</title>
</head>
<body>
<h1>Bob’s Auto Parts</h1>
<h2>Order Results</h2>
<?php
echo "<p>Order processed at " .date('H:i, jS F Y')."</p>";
echo '<p>Your order is as follows: </p>';
echo $tireqty.' tires<br />';
echo $oilqty.' bottles of oil<br />';
echo $sparkqty.' spark plugs<br />';
?>
</body>
</html>
If i use the _GEt method the values of this variables are shown but with post method nothing is retrieved.