This is login page code. After I insert the right login nothing the page does not redirect me to "customer_account_summary.php". The page just refreshes and asks me to log in again. but if I access "customer_account_summary.php" manually I can tell that it has logged in successfully.
$sql="SELECT email,password FROM customer WHERE email='$username' AND password='$password'";
$result=mysql_query($sql) or die(mysql_error());
$rws= mysql_fetch_array($result);
$user=$rws[0];
$pwd=$rws[1];
if($user==$username && $pwd==$password){
session_start();
$_SESSION['customer_login']=1;
$_SESSION['cust_id']=$username;
header('location:customer_account_summary.php');
die();
}
else{
header('location:index.php');
}}
?>
<?php
session_start();
if(isset($_SESSION['customer_login']))
header('location:customer_account_summary.php');
?>
this is the login table html
<div class="user_login">
<form action='' method='POST'>
<table align="left">
<tr><td><span class="caption">Secure Login</span></td></tr>
<tr><td colspan="2"><hr></td></tr>
<tr><td>Username:</td></tr>
<tr><td><input type="text" name="uname" required></td> </tr>
<tr><td>Password:</td></tr>
<tr><td><input type="password" name="pwd" required></td></tr>
<tr><td class="button1"><input type="submit" name="submitBtn" value="Log In" class="button"></td></tr>
</table>
</form>
</div>