I am working on a agency portal but a problem came with my headers, especially the first page when you are logging in normally you would get redirected to the dashboard.
When i run the code locally it works perfectly fine and redirects me to the dashboard but if i upload the code to the hosting and test the code i get this error:
Warning: Cannot modify header information - headers already sent by (output started at directoryname:11) in directoryname on line 75
This is the code that i'm running in the login.php file
if(password_verify($pass, $row["password"]))
{
$_SESSION["valid"] = $user;
$_SESSION['username'] = $row['username'];
$_SESSION['userid'] = $row['userid'];
echo '<div class="alert alert-success" role="alert">Logged in successfully</div>';
header("refresh: 1; url=https://portal.habbofests.com/v1/index.php?page=dashboard");
exit;
}