在windows下正常
linux
header('HTTP/1.1 301');这些可以用快要抓狂了 谁能告诉我怎么写才能显示正常
我的页面是一个404错误
我想告诉IE这个是个OK的200而不是404

解决方案 »

  1.   


    static function sendHeader($num,$rtarr=NULL){
    $sapi = php_sapi_name();
    $header_a = array(
    '200' => 'OK',
    '206' => 'Partial Content',
    '304' => 'Not Modified',
    '404' => '404 Not Found',
    '416' => 'Requested Range Not Satisfiable',
    );
    if ($header_a[$num]) {
    if ($sapi=='cgi' || $sapi=='cgi-fcgi') {
    $headermsg = "Status: $num ".$header_a[$num];
    } else {
    $headermsg = "HTTP/1.1: $num ".$header_a[$num];
    }
    if (empty($rtarr)) {
    header($headermsg);
    } else {
    return $headermsg;
    }
    }
    return '';
    }