This content has been marked as final.
Show 1 reply
-
1. Re: Notice: Undefined Index Error
Ben Pleysier Oct 4, 2014 9:10 PM (in response to Max Resnikoff)When you open the document that contains
$name = $_POST['name'];
$email = $_POST['email'];
there will have been no posted data, hence the variables will not have been populated, i.e. neither the index or the value will have been set.
You can overcome the error message you can use isset() as in
if (isset($_POST["name"]) && !empty($_POST["name"])) {
$name = $_POST['name'];
}else{
echo "name is not set";
}


