A simple google search returned this result first:
PHP: "Notice: Undefined variable" and "Notice: Undefined index"PHP: "Notice: Undefined variable" and "Notice: Undefined index"
If you follow the link you will see a much more detailed explanation, but long answer short, you get this notice because PHP sees that you use a variable that might not have been initialized and may result in some security issue. To solve that, just use isset()
before using the actual variable.
Example:
$value = isset($_POST['value']) ? $_POST['value'] : '';
The <expression> ? <value> : <value>
is called a ternary operator and its use is the same as in C. If you have more questions about anything of this feel free to ask.
If this answers your question please accept it by clicking the gray check-mark to the left, so that it becomes green. You can also vote it up by pressing the up arrow above the check-mark. And don't forget to keep coding!