Here, where you check that it is not. It should be !isset($_POST['SUBMIT']) . This is due to the fact that the SUBMIT index will not be set, therefore it will not have a value, for example true, to pass if(...) . isset() checks if the index / variable is actually set.
Try the following:
<?php if (!isset($_POST['SUBMIT'])){ //ERROR: Undefined index ?> <H2>Add Employee</H2> <form action="<?php print $_SERVER['PHP_SELF']; ?>" method="POST"> <table width="400" border="0" cellspacing="1" cellpadding="2"> <tr> <td width="100">SSN</td> <td><input name="SSN" type="text" id="SSN"></td> </tr> <tr> <td width="100"> </td> <td><input name="SUBMIT" type="SUBMIT" id="ADD" value="ADD"></td> </tr> </table> </form> <?php } else { //code here } ?>
Tanner ottinger
source share