I can’t seem to get the error message to appear? Here is the code:
[php]<?php
include(“config.php”);
session_start();
if($_SERVER[“REQUEST_METHOD”] == “POST”)
{
// username and password sent from form
$myusername=addslashes($_POST[‘username’]);
$mypassword=addslashes($_POST[‘password’]);
$sql=“SELECT id FROM user WHERE username=’”.$myusername."’";
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
$active=$row[‘active’];
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
$storedPassword = $row[’$mypassword’];
$salt = $row[‘salt’];
// use the stored salt to hash the user’s submitted password
$hashedPassword = sha1( $userPassword . $salt ).(“something”).(“something”);
// compare the stored hash to the just-created hash
if ( $storedPassword != $hashedPassword )
{
$_SESSION[‘login_user’]=$myusername;
header(“location: welcome.php”);
}
else
{
$error=“Your Login Name or Password is invalid”;
}
}
?>[/php]
Thanks