Solution 1 :

Just delete the form="usrform" from the textarea, or add it as id to your form.

Problem :

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-xammphtdocszadaniawelcome.php on line 5

Here is php script

    $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>

The only name return the value, the rest undefined

what is wrong here ?


Comment posted by maio290

Why on earth are you removing your script’s content now?