Monday, May 27, 2019

Undefined index in PHP





Possible Duplicate:
PHP: “Notice: Undefined variable” and “Notice: Undefined index”






Good day!



I am having the following error in my code:



if (!$_POST['SUBMIT']){   //ERROR: Undefined index
?>

Add Employee












SSN
 


}
else {
//code here
}
?>


How can I remove the error above? Thank you.


Answer



It should be a notice and not an error.



To fix is you'll have to check whether $_POST['submit'] is set:



if(!isset($_POST['submit'])) {
...
}

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...