Undefined variable inside textbox
<p>I'm having errors like this in 4 of the text boxes.<br>
<code>&lt;b/&gt;&lt;b&gt;Notice&lt;/b&gt;:  Undefined variable: fname in &lt;b&gt;C:\xampp\htdocs\webpage\phpmyadmin\db\form.php&lt;/b&gt; on line &lt;b&gt;..&lt;/b&gt;&lt;br /&gt;</code><br><br>
I read about similar problem from <a href="https://stackoverflow.com/questions/14766611/undefined-variable">here</a> but it didn't work for me.<br> Where did I make mistake?</p>

<pre><code>&lt;?php
if(isset($_POST['name']) &amp;&amp; isset($_POST['password'])&amp;&amp; isset($_POST['fname'])
&amp;&amp; isset($_POST['lname']) &amp;&amp; isset($_POST['email'])){
$name = $_POST['name'];
$pass = $_POST['password'];
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$email = $_POST['email'];
$passhash = md5($pass);
}
?&gt;

&lt;form action="#" method="POST"&gt;
Name:&lt;br&gt;
&lt;input type="text" name="name" value="&lt;?php echo $name ?&gt;"&gt;&lt;br&gt;
Password:&lt;br&gt;
&lt;input type="password" name="password"&gt;&lt;br&gt;
Firstname:&lt;br&gt;
&lt;input type="text" name="fname" value="&lt;?php echo $fname ?&gt;"&gt;  &lt;br&gt;
Lastname:&lt;br&gt;
&lt;input type="text" name="lname" value="&lt;?php echo $lname ?&gt;"&gt; &lt;br&gt;
Email:&lt;br&gt;
&lt;input type="text" name="email" value="&lt;?php echo $email ?&gt;"&gt;&lt;br&gt;
&lt;input type="submit" value="Submit"&gt;
&lt;/form&gt;
</code></pre>