Login error does not appear

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

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