i know that XAMPP has got many issues on Win 7. So i installed it succesfully and now i have unspecific errors which i’ve never had before.
I have a simple -tag in HTML
<form method="post" action="site.php">
<input type="text" name="NAME">
</form>
And my PHP code is also just that simple:
<?php
$something = $_POST['NAME'];
?>
When i start XAMPP and open this HTML in “htdocs” there is an issue/Notice:
Notice: Undefined index: wert in C:\xampp\htdocs\test.php on line 40
Is that just an XAMPP error?? Because i’ve never had this issue before and it seems quiet correct. I’m using XAMPP 1.7.7 i suppose.
Greetings 🙂
The ‘Undefined index’ notice pops up when you use the value of an array index which has not been set until then:
The third line will give: “Notice: Undefined index: c in C:\xampp\htdocs\test.php on line 3”.
This is something that typically occurs when you access the $_GET or $_POST arrays. Most often, the reason is that you mispelled the index (e.g. you typed
$_POST['tset']instead of$_POST['test']) or because you edited an<input>element in the HTML form which submits the information and then forgot to readjust the PHP code.You can make sure that everything is working fine by testing if the index exists using
isset()like so:A very common line that you will find in a lot of scripts:
This uses a special PHP shorthand of the if-else structure. This line does pretty much exactly the same as: