PHP Header redirection not working on Website, but working on localhost

Hello, i did a login page that after logged in create a session and save the user in the session, then with header('Location: dashboard.php'); It goes to the new page, the admin dashboard. When i try it on my local pc in visual studio with extension serve server, everything is fine. When i upload the files on my cPanel it doesn't work. It creates the session user variable but doesn't execute the header. I can't understand why. Everything in the code works until the header instruction on the server! On my local pc works on live server.
No description
1 Reply
DimitriUI
DimitriUIOP12mo ago
After taking a break playing 2 hours of Resident Evil 4 Remake and getting back i somehow finally understood the problem. Everywhere they wrote "it must be used before any UPLOAD type" and it burry my mind. Anywhere was written it must be in front of every HTML, PHP element. 2 hours of struggle i lost for something so stupid. I hate php
Want results from more Discord servers?
Add your server