Try:
PHP Code:
function login(){
if (!$_POST[login]) {
global $Ybox;
$Ybox->top("Welcome Guest");
echo("<form method='POST' style='margin: 0px;'>
<div style='text-align: center; padding: 3px;'>
Username: <br>
<input type='text' size='15' maxlength='25' $read name='username'><br>
Password: <br>
<input type='password' size='15' maxlength='25' $read name='password'><br>
</div>
<br>
<center><input type='submit' name='login' value='Login'> <input type='reset' name='reset' value='Reset'><br><br>
</form>
<a href='/register/'>Register</a> | <a href='/forgotpass/'>Forgot Password?</a></center>");
$Ybox->stop();
}else{
$username = safe($_POST["username"]);
$info = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());
$data = mysql_fetch_array($info);
$password = md5(md5($_POST['password']) . $data['salt']);
if($data[password] != $password) {
global $Nav;
Bbox ("Error","Incorrect Username or Password, Please go back and fix this.");
}else{
Rbox("Success","<center>Please wait as you are being logged in!</center>");
}
}
}