Issue with php form processing using Object Oriented Programming concept
<p>I am very new to  PHP . I was asked to create a very simple form in PHP using OOPS . I managed to create a single page form with 2 text fields (name and ID) but the issue I am facing now is that  when user clicks on submit button only the name gets stored in the database but not the ID . Could you please help me out in this . 
Below is the sample code 
Thank You in advance</p>

<p>PERSON.PHP</p>

<pre><code>&lt;?php
class person
{
    var $id;
    var $name;
    function set_id($new_id)
    {
        $this-&gt;id=$new_id;
    }

    function get_id()
    {
        return $this-&gt;id;
    }

    function set_name($new_name)
    {
        $this-&gt;name=$new_name;
    }

    function get_name()
    {
        return $this-&gt;name;
    }
}
?&gt;
</code></pre>

<p>DBINPUT.PHP</p>

<pre><code> &lt;?php
 include 'person.php';
 ?&gt;
 &lt;html&gt;
 &lt;body&gt;
 &lt;form action="dbinsert.php" method="post"&gt;
  NAME&lt;input type="text" name="name" &gt;/
  ID&lt;input type="text" name="ID" /&gt;
  &lt;input type="submit" value="submit"&gt;
  &lt;/form&gt;
  &lt;/html&gt;
    &lt;/body&gt;
</code></pre>

<p>DBINSERT.PHP</p>

<pre><code> &lt;?php
    include("person.php");
    $con = mysql_connect("localhost", "cgiadmin", "cgi");
    if (!$con)
    {
        die("couldn't connect ".mysql_error());
    }
    mysql_select_db("oops", $con);

    $person = new person;
    $person-&gt;set_name($_POST['name']);

    $person1 = new person;
    $person1-&gt;set_id($_POST['id']);


    $sql="INSERT INTO smallprogramusingoops (NAME ,ID ) VALUES ('".$person-&gt;get_name()."','".$person1-&gt;get_id()."')";
    if (!mysql_query($sql, $con))
    {
    die('Error in inserting '.mysql_error());
    }

    ?&gt;
</code></pre>

<p>Could you please rectify my mistake ?</p>
