How to do a bypass in an HTTP redirect?

3

Is there any way to do a bypass and access the page? For example:

if(!isset($variavel)) { 
  header ('Location: error.php');
} else {
  echo 'oi';
}
    
asked by anonymous 06.03.2014 / 04:47

1 answer

3

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.

    
06.03.2014 / 05:00