PHP/HTML problems :(
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8260524/undefined-index-when-using-post">Undefined Index when using post</a>  </p>
</blockquote>



<p>I'm a beginner php developer and I'm just playing around with some stuff. I'm trying to create a simple registration form:</p>

<p><strong>registration.php</strong></p>

<pre><code>&lt;?php

include('Auth.php');

$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email= $_POST['email'];
$password = $_POST['password'];

$auth = new Auth();
$auth-&gt;register($first_name, $last_name, $email, $password);

?&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
&lt;title&gt;Registration&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form action="registration.php" method="POST"&gt;

        &lt;p&gt; First Name: &lt;input type="text" size="20" name="first_name" id="first_name" value="" /&gt; &lt;/p&gt;
        &lt;p&gt; Last Name: &lt;input type="text" size="40" name="last_name" id="last_name" value="" /&gt;&lt;/p&gt;
        &lt;p&gt; Email: &lt;input type="text" size="60" name="email" id="email" value="" /&gt;&lt;/p&gt; 
        &lt;p&gt; Password: &lt;input type="password" size="16" name="password" id="password" value="" /&gt;&lt;/p&gt;

        &lt;input type="submit" value="submit" id="submit"/&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I get these errors:</p>

<pre><code>Notice: Undefined index: first_name in C:\xampp\htdocs\Store\Store\Controller\Registration.php on line 6

Notice: Undefined index: last_name in C:\xampp\htdocs\Store\Store\Controller\Registration.php on line 7

Notice: Undefined index: email in C:\xampp\htdocs\Store\Controller\Registration.php on line 8

Notice: Undefined index: password in C:\xampp\htdocs\Store\Store\Controller\Registration.php on line 9
</code></pre>

<p>I'm guessing it's because the POST variable has nothing inside it yet because nothing has been submitted. I've seen around on the internet where the php processing form and the html form is in the same file as opposed to two separate files like what I'm trying to do. Where the html form refers back to itself. How can I go around this? Is this even good practice when it comes to separation of content and data processing?</p>

<p>I</p>
