I am using a function with a name headerLocation()to redirect correctly. This is the relevant part of the function, I use it to redirect and then display the corresponding message (personal preference).
function headerLocation($location,$message)
{
$_SESSION['output'] = $message;
header("Location: ". $location);
}
The problem is that when the script starts, the part is header("Location: ". $location);activated without even calling the function (when I initially require it to parse php). This makes the function useless.
Is there any way around this?
source
share