Forum Moderators: coopster
Default argument values [php.net]
I did see this
The default value must be a constant expression, not (for example) a variable, a class member or a function call.
do you get errors of any kind?
what exactly happens when you try the first example?
$_SERVER['HTTP_REFERER'] is a variable. Can't do that, pixeltierra. As a workaround, what you can do is pass in something else, like maybe a boolean false value. If the variable passed is exactly equal to false you can set it to the value of the superglobal ...
function http_redirect ($location = false, $msg = "Processing", $delay = 0)
{
if ($location === false) {
$location = $_SERVER['HTTP_REFERER'];
}
...