$_POST does not work in PHP7.2 UBUNTU 18.04

Asked by pat on 2018-08-07

I have tried fresh installs and currently this is off the flash drive downloaded today from the site. I have searched for a week and half to no avail. I was working on another project so i copied the short example so that there would not be 100's of code lines,The funny thing is that $_GET works fine

Thank You Pat

HERE IS THE CODE

<!DOCTYPE html>
<html>
<head>
<title> order form</title>
<link rel='stylesheet' type='text/css' href='css/prac.css' />
</head>
 <body>
  <form action = "processorder.php" mehtod = "post">
 <table>
  <tr>
    <td class= "item">Item</td>
    <td clas = "qty">Quanity</td>
  </tr>
  <tr>
    <td>Tires</td>
    <td><input type = "text" name = "tireqty" size="3" maxlength="3" /></td>
  </tr>
  <tr>
    <td>Oil</td>
    <td><input type="text" name="oilqty" size="3" maxlength="3" /></td>
  </tr>
  <tr>
  <td>Spark Plugs</td>
    <td><input type="text" name="sparkqty" size="3" maxlength="3"</td>
  </tr>
  <tr>
    <td class="sub" colspan="2"><input type="submit" value="submit Order" /></td>
  </tr>
 </table>
  </form>

 </body>
</html>

<?php
var_dump($GLOBALS);

$tireqty = $_POST['tireqty'];
$oilqty = $_POST['oilqty'];
$sparkqty = $_POST['sparkqty'];
?>

<!DOCTYPE html>
<html>
<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 ";
  echo date('H:i, jS F Y');
  echo "</p>";

  echo '<p>Your order is as follows;</p>';
  echo htmlspecialchars($tireqty).' tires<br />';
  echo htmlspecialchars($oilqty).' oil <br />';
  echo htmlspecialchars($sparkqty).' spark plugs <br />';

  echo '<pre>';
print_r($_POST);

  ?>
</body>
</html>

AND HERE IS THE RESULTS

array(5) { ["_GET"]=> array(3) { ["tireqty"]=> string(1) "4" ["oilqty"]=> string(1) "4" ["sparkqty"]=> string(1) "2" } ["_POST"]=> array(0) { } ["_COOKIE"]=> array(0) { } ["_FILES"]=> array(0) { } ["GLOBALS"]=> array(5) { ["_GET"]=> array(3) { ["tireqty"]=> string(1) "4" ["oilqty"]=> string(1) "4" ["sparkqty"]=> string(1) "2" } ["_POST"]=> array(0) { } ["_COOKIE"]=> array(0) { } ["_FILES"]=> array(0) { } ["GLOBALS"]=> *RECURSION* } }
Bob's Auto Parts
Order Results

Order Processed at 18:12, 7th August 2018

Your order is as follows;
tires
oil
spark plugs

Array
(
)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
2018-08-08
Last query:
2018-08-08
Last reply:
2018-08-07

I suggest you report a bug

pat (patswof) said : #2

Thanks actionparsnip, that solved my question.