I have a simple form I wnt to submit with PHP, unfortunately, I am getting an error, here is the error
Notice: Undefined index: comment in C:\custom-xammp\htdocs\zadania\welcome.php on line 5
Here is php script
<?php
if(isset($_POST['submit']))
{
$name = $_POST['name'];
$comment =$_POST['comment'];
$radio = $_POST['MyRadio'];
echo "Name : <b> $name </b>";
echo "<br>Commennt: <b> $comment </b";
echo "<br>Radido: <b> $radio </b";
}
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
Name: <input type="text" name="name"><br><br>
Text: <textarea name="comment" form="usrform">Enter text here...</textarea><br><br>
Checkbox: <input type="radio" name="MyRadio" value="Second" /><br><br>
<input type="submit" name="submit" value="Submit Form"><br>
</form>
The only name return the value, the rest undefined
what is wrong here ?