Is there any way to do a bypass and access the page? For example:
if(!isset($variavel)) {
header ('Location: error.php');
} else {
echo 'oi';
}
Is there any way to do a bypass and access the page? For example:
if(!isset($variavel)) {
header ('Location: error.php');
} else {
echo 'oi';
}
I do not know if you consider this a bypass , but issuing the header does not end the script. You should do this manually with exit
after a redirect, or the script goes on:
if(!isset($variavel)) {
header ('Location: error.php');
exit;
} else {
echo 'oi';
}
// Chegaria aqui sem o exit
If your question is about running% code of your code, this has nothing to do with redirection. It all depends on whether the variable else
is set or not. Of course, if the redirection code of your example runs, you do not have $variavel
to run as well.