title: Undefined index error PHP
body: <p>I'm new in PHP and I'm getting this error:</p>
  
  <blockquote>
    <p>Notice: Undefined index: productid in /var/www/test/modifyform.php on
    line 32</p>
    
    <p>Notice: Undefined index: name in /var/www/test/modifyform.php on line
    33</p>
    
    <p>Notice: Undefined index: price in /var/www/test/modifyform.php on line
    34</p>
    
    <p>Notice: Undefined index: description in /var/www/test/modifyform.php
    on line 35</p>
  </blockquote>
  
  <p>I couldn't find any solution online, so maybe someone can help me.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>&lt;form action="&lt;?php echo $_SERVER['PHP_SELF'];?&gt;" method="POST"&gt;
     &lt;input type="hidden" name="rowID" value="&lt;?php echo $rowID;?&gt;"&gt;
  
     &lt;p&gt;
        Product ID:&lt;br /&gt;
        &lt;input type="text" name="productid" size="8" maxlength="8" value="&lt;?php echo $productid;?&gt;" /&gt;
     &lt;/p&gt;
  
     &lt;p&gt;
        Name:&lt;br /&gt;
        &lt;input type="text" name="name" size="25" maxlength="25" value="&lt;?php echo $name;?&gt;" /&gt;
     &lt;/p&gt;
  
     &lt;p&gt;
        Price:&lt;br /&gt;
        &lt;input type="text" name="price" size="6" maxlength="6" value="&lt;?php echo $price;?&gt;" /&gt;
     &lt;/p&gt;
  
     &lt;p&gt;
        Description:&lt;br /&gt;
        &lt;textarea name="description" rows="5" cols="30"&gt;
        &lt;?php echo $description;?&gt;&lt;/textarea&gt;
     &lt;/p&gt;
  
     &lt;p&gt;
        &lt;input type="submit" name="submit" value="Submit!" /&gt;
     &lt;/p&gt;
     &lt;/form&gt;
     &lt;?php
     if (isset($_POST['submit'])) {
        $rowID = $_POST['rowID'];
        $productid = $_POST['productid']; //this is line 32 and so on...
        $name = $_POST['name'];
        $price = $_POST['price'];
        $description = $_POST['description'];
  
  }
  </code></pre>
  
  <p>What I do after that (or at least I'm trying) is to update a table in MySQL.
  I really can't understand why <code>$rowID</code> is defined while the other variables aren't.</p>
  
  <p>Thank you for taking your time to answer me.
  Cheers!</p>