I develop under windows. Why will my redirect be giving this error:

Warning: Cannot modify header information - headers already sent by
(output started at
c:\inetpub\wwwroot\nacd\includes\functions.inc.php:67) in
c:\inetpub\wwwroot\nacd\includes\functions.inc.php on line 232

My code is:

$insertGoTo = "Login.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
   $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
   $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
KT_redir($insertGoTo);

function KT_redir($url) {
                        global $HTTP_SERVER_VARS;
                        $protocol = "http://";;
                        $server_name = $HTTP_SERVER_VARS["HTTP_HOST"];
                        if ($server_name != '') {
                                $protocol = "http://";;;
                                if (isset($HTTP_SERVER_VARS['HTTPS']) && 
($HTTP_SERVER_VARS['HTTPS']
== "on")) {
                                        $protocol = "https://";;
                                }
                                if (preg_match("#^/#", $url)) {
                                        $url = $protocol.$server_name.$url;
                                } else if (!preg_match("#^[a-z]+://#", $url)) {
                                        $url = 
$protocol.$server_name.(preg_replace("#/[^/]*$#", "/",
$HTTP_SERVER_VARS["PHP_SELF"])).$url;
                                }
                                header("Location: ".$url);
                        }
                        exit;
                }

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to