2
How do I header a page that is one level up, e.g.: I have the following directory tree, I want to header from validarLogin.php to welcomePage.php? I tried using a .. / to access the views folder and it didn’t work
controller --- validarCadastro.php --- validarLogin.php views --- index.php --- welcomePage.php
Redirect code:
$string = http_build_query($consulta);
$url = 'Location:'.'../views/welcomePage.php?'.$string;
header($url);
Because you don’t take some form of (or create a way to get) the base url of your application. This would solve the problem.
– Wallace Maxters
how so? I am accessed by localhost, the full address is:
localhost/PHP/Site/modules/users/views/welcomePage.php
– Ricardo
Show us the redirect code so we can help
– Wallace Maxters
If used
'Location:'.'http://localhost/PHP/Site/modules/users/views/ewelcomePage.php?'.$string;
works– Ricardo
What’s your structure like? where do you call this Location? Which file? goes through an index.php outside of these directories for redirection??
– Tafarel Chicotti
It does not pass an index, this redirection is located at the end of the login validation and is independent of the result (logged in or not)
– Ricardo