Forum Moderators: coopster
$insertGoTo = "notify.php?=";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?'))? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
The record is inserted just fine, and if I echo the $insertGoTo string, it shows exactly what it should. Why is it not loading?
http://example.com/notify.php?name=value
HTTP/1.1 requires an absolute URI as argument to
Location:including the scheme, hostname and absolute path, even though some clients accept relative URIs. See header() [php.net] for details.
[edited by: coopster at 4:47 pm (utc) on Feb. 23, 2006]
printf("Location: %s", $insertGoTo); Location:
$insertGoTo = "notify.php?=";
$insertGoTo = "notify.php";
$http = 'http' . ((isset($_SERVER['https']) && $_SERVER['https'] == 'on') ? 's' : '') . '://';
$host = $_SERVER['HTTP_HOST'];
$path = dirname($_SERVER['SCRIPT_NAME']);
$insertGoTo = "notify.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: $http$host$path/%s", $insertGoTo));
$http = 'http' . ((isset($_SERVER['https']) && $_SERVER['https'] == 'on') ? 's' : '') . '://';
$host = $_SERVER['HTTP_HOST'];
$path = dirname($_SERVER['SCRIPT_NAME']);
$insertGoTo = "notify.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?'))? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
printf("Location: %s", $insertGoTo);
exit;
header(sprintf("Location: $http$host$path/%s", $insertGoTo));