Hi all kinda new with php and forms so wondering if someone could help me out. I have a form with 4 text fields which are used to add the fields with the result in the 4th field. When i submit the field result the 4th field then displays the result but does not show the result in the $_Post array. How do i get the result to show in the array?
Here is my code. Thanks for the help.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<?php
$a = $_POST[1];
$b = $_POST[2];
$c = $_POST[3];
$d = $a + $b + $c;
print_r ($_POST);
?>
</head>
<body>
<form action="" method="post">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input name="1" type="text" value="<?= $a ?>" /></td>
<td><input name="2" type="text" value="<?= $b ?>"/></td>
<td><input name="3" type="text" value="<?= $c ?>"/></td>
<td><input name="4" type="text" value="<?= $d ?>" /></td>
<td><input name="submit" type="submit" value="submit" /></td>
</tr>
</table>
</form>
</body>
</html>