Ok thnks i ll try it out and ll inform u
Hey zakia,
Sorry about that i copied the wrong code.
Here it is.
[php]
<?php require_once("dbc.php");?> <?php //require_once("functions.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_query("SELECT id,usr FROM tz_members WHERE usr='".$_POST['username']."' AND pass='".$_POST['password']."'"); var_dump($row); $result = mysql_fetch_assoc($row); if($result['usr']) { header("Location:memberpage.php"); } else $err[]='Wrong username and/or password!'; } if($err){ $message=implode("",$err); } } ?> Login
Login
<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>
[/php]
Regards,
developer.dex2908
i Have solved my problem today in fact i was not selecting the password and was trying to match it ;D that’s y i was going wrong the correct is now as follow:
[php]$query = mysql_query(“SELECT id,usr FROM tz_members WHERE usr=’”.$_POST[‘username’]."’");
$numrows=mysql_num_rows($query);
if($numrows!=0){
header("Location: memberpage.php");
}else{
$err[]="Wrong Username/Password";
}
}[/php]
now its working well
any way thanks to all my helping friends