0
I’m using the following code:
if (!$lRet):
// Volta para o cartão eletrônico.
header('Location: '.$_SESSION['CFG_DIR_ROOT'].'index.php');
endif;
This way it just doesn’t work and keeps running the script, but if we include a line of code below header() it works.
if (!$lRet):
// Volta para o cartão eletrônico.
header('Location: '.$_SESSION['CFG_DIR_ROOT'].'index.php');
die();
endif;
This way it works, IE, goes to index.php and does not run die(). If I replace die() [Exit() also works] with another instruction like echo or $a = 'b', etc., it also doesn’t work.
What is the magic ?
Today I will try to run on another server, this time Linux, to see if I have different functioning or some error message. Then put here the result.
Enable PHP error flags, you’ll probably get a message like "Headers already sent". Post here the error output message, based on it I can better guide you.
– Fábio Jânio
Thanks for your attention Fábio. Error messages are enabled. It happens that there is no error, simply when I do not put the die() line; the impression is that there is no if. It simply follows below. With die(); it follows the header() instruction but the die() instruction is never executed.
– HumbertoDONTEC
Good morning, don’t post answers inside the question, so use the answer button. In this case you don’t even need to post an answer, since the problem has nothing to do with linux or die or Exit and yes you didn’t turn on php errors using
error_reporting(E_ALL)
, this answer already responds well to your problem http://answall.com/a/18812/3635– Guilherme Nascimento