2012-10-16 3 views

답변

1

header() 기능이 필요합니다.

void header (string $string [, bool $replace = true [, int $http_response_code ]])

찾는 것이 바로 응답 출력 렌더링 스크립트 제 <?php 태그 후.

당신은 http://php.net/manual/en/function.header.php

1

봐 :

header('HTTP/1.0 404 Not Found'); 

넣어 스크립트의 모든 출력 전에.

0

보내기 참조해야 클라이언트에 다른 것을 보내 header() 전에. 가능한 상태 헤더는 다음과 같습니다.

header('HTTP/1.1 200 OK'); 

// Page was not found: 
header('HTTP/1.1 404 Not Found'); 

// Access forbidden: 
header('HTTP/1.1 403 Forbidden'); 

// The page moved permanently should be used for 
// all redrictions, because search engines know 
// what's going on and can easily update their urls. 
header('HTTP/1.1 301 Moved Permanently'); 

// Server error 
header('HTTP/1.1 500 Internal Server Error'); 

// header for telling the browser that the content 
// did not get changed 
header('HTTP/1.1 304 Not Modified');