Hi, i am reciving this error on my web hosted by 000webhost, but is not my web, i downloaded from the file explorer and tested with xampp and all work fine, this is the code
<?php session_start();if(!isset($_SESSION['username'])){header("location: login.php"); exit;}?>
and of course the code is on top without white space on the start or end, so i am not sure what is happening
Make sure you’re not sending the headers after sending any other output. If you are not aware how headers are working, please add the following line to /public_html/.htaccess. It’ll most likely solve your issue