Here is my code: I have started the session at the top of the page index.php already `
if(isset($_POST['btsubmit'])){
$username=$_POST['txtname'];
$password=$_POST['txtpass'];
$sql="SELECT * FROM tbuser WHERE AccountName='$username' AND Password='$password'";
$query=mysql_query($sql) or die(mysql_error());
if($username="" or $password=""){
echo"Your box is empty";
}else{
if($row = mysql_fetch_array($query)){
$_SESSION['AccountName']= $row['AccountName'];
header("Location: welcome.php");
exit();
}else{
echo "fail";
}
}
}
?>` When I login success, it does not redirect to the page welcome.php, it stays at index.php the same. Any help would be appreciated. Thanks..