Hello I have a weird Problem with PHP and HTML.
I made a Page with a contact form that contains a Buttons that redirects to a workings space that is only accessable when you are loged in. Else you are redirected to the login page.
First my back button in under contact is defined like this:
<a href="https://myhompage.com/admin/index.php" data-role="button" data-icon="arrow-l" style="width: 60px;">Back</a>
Then in the index.php is a file called with require_once that checks if the session is valid or not. If valid do nothing if not reirect to login.php
header("Location: https://lmyhomepage.com/login.php", true, 302);
exit;
I Tryed just ../login.php with and without the 2 variables. I Change code 302 to 303.
I changed exit to die and nothing works right.
The URl in my browser says https://myhompage.com/admin/index.php while login.php is mostly loaded exept for js code and an image. Hte JS code is directly in the login.php implemented but does not work. If I press F5 or just normaly reload the page the URL CHanges to https://myhompage.com/login.php and then everything works fine. Does anyone now where I go wrong?