Sunday 31 December 2017

Undefined index in PHP

itemprop="text">












Good
day!



I am having the following error in my
code:



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

Add
Employee



cellpadding="2">


width="100">SSN



width="100"> 



id="SSN">
type="SUBMIT" id="ADD" value="ADD">




}
else {
//code here

}
?>


How
can I remove the error above? Thank you.


class="post-text" itemprop="text">
class="normal">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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...