php login: undefined index
<p>Im very new to php and this is my first go on on this login.
so when im typing in a valid username and password from the database im getting these two errors:</p>

<p>Notice: Undefined index: brukernavn on line 3</p>

<p>Notice: undefined index: passord on line 4<br>
    

<pre><code>$username = $_POST['brukernavn'];
$password = $_POST['passord'];

if($username&amp;&amp;$password)
{

$connect = mysql_connect("localhost", "root", "") or die ("Cannot connect");
mysql_select_db("prosjekt") or die ("Cant find db");

$query = mysql_query("SELECT * FROM bruker WHERE brukernavn='$username'");

$radnum = mysql_num_rows($query);

if ($radnum!=0)
{

while ($rad = mysql_fetch_assoc($query))
{
    $dbuser = $rad['brukernavn'];
    $dbpass = $rad['passord'];
}

if ($username==$dbuser&amp;&amp;$password==$dbpass)
{
echo "Logged in";
}
else
    echo "Wrong username or password";

}
else
    die("That user does not exist!");


}
else
    die("Please enter a username and password!");




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

<p>Could anyone see where i went wrong here?</p>
