Login error does not appear

I can’t seem to get the error message to appear? Here is the code:

// username and password sent from form
$sql=“SELECT id FROM user WHERE username=’”.$myusername."’";

// 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 )
header(“location: welcome.php”);
$error=“Your Login Name or Password is invalid”;


Sorry I forgot the form looks like this:

<div style="font-size:11px; color:#cc0000; margin-top:10px"><?php echo $error; ?></div> <h3 class="whatareyou2">Member Login</h3> <form action="" method="post"> <p><input type="text" name="username" id="username" placeholder="Username" ></p> <p><input type="password" name="password" id="password" placeholder="Password" ></p> <p align="center" class="submit"><input type="submit" name="commit" value="Login"></p> </form>

Sponsor our Newsletter | Privacy Policy | Terms of Service