hey all i have this code, the query works totally fine but the header no please help , this is my code i appreciate it
<?php
if (isset($_POST['login'])){
$username=$_POST['username'];
$pass=$_POST['password'];
$hashedpass=md5($pass);
$query="SELECT username, password FROM users WHERE username='$username' AND password='$hashedpass'";
echo $query;
$run=mysqli_query($con, $query);
$rows=mysqli_num_rows($run);
if ($rows > 0){
$_SESSION['username'] = $username;
header('Location: index.php');
exit();
}
}
?>
Username
Password