title: error "Undefined index" with a form in PHP
body: <p>I have this code and I have two problem 
  the one is this line:</p>
  
  <blockquote>
    <p>Notice: Undefined index: elm1 in C:\xampp\htdocs\art-legend\12\edit\index.php on line 65</p>
  </blockquote>
  
  <p>line 65 in my local is in this page this line 
  ( $editor = $_POST['elm1'];)</p>
  
  <p>and the other error: when I submitted the code go to no page (Object not found!) and this is the form code in the same page:</p>
  
  <pre><code>&lt;form method="post" action="&lt;? echo $PHP_SELF; ?&gt;"&gt;
  
                  &lt;div&gt;
                  &lt;textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%"&gt;
              ....
                  &lt;/textarea&gt;
              &lt;/div&gt;
              &lt;br /&gt;
          &lt;input type="submit" value="gooooo" name="submit" /&gt;
  
      &lt;/form&gt;
  &lt;?
  
  $localhost = "localhost";
  $user = "root";
  $password ="adminpass"; 
  $db = "im";
  
  $connect = mysqli_connect($localhost,$user,$password,$db);
  $editor = $_POST['elm1'];
  
  $sql = "insert into images(name) values('$editor')";
  $query = mysqli_query($connect,$sql);
  
  $sql2 = "select images.name from images";
  $query2 = mysqli_query($connect,$sql2);
  
  while ($row = mysqli_fetch_array($query2,MYSQLI_ASSOC)){
      echo $row['name'];
  
      }
  
  ?&gt;
  </code></pre>
  
  <p>the line in this code </p>
  
  <pre><code>$editor = $_POST['elm1'];
  </code></pre>