note 12316 deleted from function.header by jimw

From: Date: Wed, 31 Oct 2001 21:57:18 +0000
Subject: note 12316 deleted from function.header by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-19772@lists.php.net to get a copy of this message
header(), session variables and exit() <p>My session variables were not being passed from page to page. The problem was that I called a function which only contained the instruction <p>header(location:menu.php) <p>and expected that the rest of my script would be disregarded as soon as this instruction was executed. Actually the function returned to the calling code which eventually contained a session_destroy() intruction. <p>Of course putting exit() at the end of my function resolved everything. <p>Moral: Dont assume that your code will stop after a header(location:...) instruction.

« previous php.notes (#19772) next »