[php]<?php
if(isset($_POST[‘login’]))
{
// Checking whether the Login form has been submitted
$err = array();
// Will hold our errors
if(!$_POST['username'] || !$_POST['password'])
$err[] = 'All the fields must be filled in!';
if(!count($err))
{
$_POST['username'] = mysql_real_escape_string($_POST['username']);
$_POST['password'] = mysql_real_escape_string($_POST['password']);
// Escaping all input data
$row = mysql_fetch_assoc(mysql_query("SELECT id,usr FROM tz_members WHERE usr='{$_POST['username']}' AND pass='".sha1($_POST['password'])."'"));
if($row['usr'])
{
header("Location:memberpage.php");
}
else $err[]='Wrong username and/or password!';
}
if($err){
$message=implode("<br/>",$err);
}
}
?>[/php]
This my php code problem is that its not redirecting me to memberpage.php even i m doing correct entries according to my Datbase records. its still showing me Wrong username and/or password!’;
plz help me where i m going wrong???
[code]
LoginLogin
<div class="box">
<?php
if(!empty($message))
{
echo '<div class="err">'.$message.'</div>';
}
?>
<label>Username:</label>
<input name="username" type="text" class="textbox" id="user">
<label>password:</label>
<input name="password" type="password" class="textbox" id="password"><br/>
<label><input name="rememberMe" type="checkbox" id="rememberMe" value="">Remeber Me
<span>|<a href="#"> Forgot Password</a></span></label>
<br/>
<input name="login" type="submit" value="Login" class="btn" id="login"><span><a href="reg.php">Sign Up</a></span>
</div>
</form>