Undefined Index when using post
<p>I'm getting undefined index errors on the $_POST variables. I.E. $_POST['hostname']. I know kinda why I'm getting them, but is there a way to keep the php and form in the same file and not get these errors?    </p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Install Forum&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Please enter your database information&lt;/h1&gt;

&lt;form action='install.php' method='post'&gt;
Hostname: &lt;input type='text' name='hostname'&gt;&lt;br/&gt;
MySQL User: &lt;input type='text' name='dbuser'&gt;&lt;br/&gt;
MySQL Pass: &lt;input type='password' name='dbpassword'&gt;&lt;br/&gt;
&lt;input type='submit' name='submit' value='Submit'&gt;&lt;br/&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;?php
include_once("config.php");
$date = date('Y-m-d');

//Database Variables
$dbhost = strip_tags($_POST['hostname']);
$dbuser = strip_tags($_POST['dbuser']);
$dbpass = strip_tags($_POST['dbpassword']);
$submit = isset($_POST['submit']);
</code></pre>
