As described in Mr. Pengwuchen's PHP BIBLE, the header can send a status header, such as
header ("status:404 not Found");
?>
can make the user's browser appear file cannot find 404 error, but I tried this is not possible.
later I went to w3.org to check the relevant information on HTTP, finally tried out how to header out the status code (status), and share with you.
actually should be like this:
Header ("http/1.1 403 Forbidden");
?>
The first part of
is the version of the HTTP Protocol (http-version)
the second part is state code (status)
Part III is divided into causal phrases (reason-phrase)
three parts of the middle with a space to separate, and the middle can not have a carriage return, the first part and the second part is necessary, the third part is for people to read, can not write or even write.
also, the output of this sentence must be in the first line of the HTML file.
below I give the meaning of each code (it is from the w3.org to find, enough authority):
* 1xx:informational-request received, continuing process
* 2xx:success-the Action was successfully received, understood,
and Accepted
* 3xx:redirection-further action must be taken into order to
Complete the request
* 4xx:client error-the request contains bad syntax or cannot be
fulfilled
* 5xx:server error-the Server failed to fulfill a apparently
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.