This is my first topic so far in this great webpage
The problem is this:
I'm scripting an UCP (PHP & MySQL based). I want it to show the user's status like score, money, etc. (Yeah, it's for a game) but when I click on the login button nothing happens it just erases the content of the requested fields.
It was working properly before I made some changes (Checking if the username exists)
Here's the code:
if (isset($_POST['login'])) 
{
    $hashedpass = hash('whirlpool', $password); 
    $query = "SELECT * FROM users WHERE Username = '$playername' AND Password = '$hashedpass'";
    $result = mysql_query($query);
    $num = mysql_num_rows($result);
    mysql_close();
    if($num != 0)
    {
        echo"Account doesn't exist!";
        header("Location: ucp.html");
    }
    else 
    {
        $name=mysql_result($result,$i,"UserName");
        $money=mysql_result($result,$i,"Money");
        $score=mysql_result($result,$i,"Score");
        $wantedlevel=mysql_result($result,$i,"WantedLevel");
        $adminlevel=mysql_result($result,$i,"AdminLevel");
        echo "<b>$name</b><br>Money: $money<br>Score: $score<br>Wanted Level: $wantedlevel<br>Admin Level: $adminlevel<br><br>";        
    }   
}
else if (isset($_POST['register'])) 
{
    header("Location: register.html");
}
else 
{
    header("Location: index.html");
}
 
     
     
     
    