if (true)
{
Header (' location:http://bbs.it-home.org ');
}
File_put_contents (' test.txt ', ' OK ');//This line, generate a Test.txt file, the contents of the file is OK
Copy CodeIn this code, the careless programmer
What we're going to introduce to you today is about
PHP header function sends a 404 status code to the browserHeader ("http/1.1 404 Not Found");OrHeader ("http/1.1 404″");
PHP Header Function Permanent redirectHeader
When you jump through the header of PHP (' location:http://www.111cn.net '). Sometimes it doesn't work. There are several reasons to follow:
Wrong spelling
location and ":" No spaces between the number, or there will be an error.
• You cannot
PHP header after the need to write exit to terminate the program, has not been too concerned about, today encountered a bug, only to find that this is still a problem, deliberately wrote a piece of code test, the code is as follows:
The result
What we want to introduce to you today is
// The PHP header function sends a 404 status code to the browser.Header ("HTTP/1.1 404 Not Found ");OrHeader ("HTTP/1.1 404 ″);
// PHP header function permanent redirectionHeader ("Location:
Compare the php header with the redirect in asp. Read the php header and the redirect in asp, and use response to implement redirection in asp. redirect function: Usage example: response. redirect .. /test. aspphp also has a similar function: header
After the php header, do you need to write exit to terminate the program? I didn't care too much about it before. Today I encountered a bug and found this problem. I wrote a code segment to test it, the Code is as follows:
It turns out that if
PHP header after the need to write exit to terminate the program, has not been too concerned about the past, today encountered a bug, just found that this is still a problem, deliberately wrote a paragraph of code test, the code is as follows:
What's the function of the PHP header function? In PHP, the header function can be used as two special headers to send the status code, you can replace the previous same type of header, you can also force specify the value of the HTTP response, then
Php header () usage problems caused by WebInspect attacks
The latest project was under severe attacks by the test group, exposing many problems. One of the questions is impressive!
The WebInspect scanning tool was used in the test to scan the
In the sublime editor, how can I quickly enter the Sublime menu bar of the PHP header version declaration-& gt; Tools → NewSnippet → to obtain the following content: & lt; snippet & gt; & lt; content & gt; & lt ;! [CDATA [& lt ;? Php *** @ version1.0
Common http header settings for php header Functions
This article mainly introduces the common http header settings of php header functions. This article provides code examples. The Code contains detailed comments. For more information, see
?
How to hide the output (X-Powered-By) information of the php header version
This article describes how to hide the version output x-powered-by of the php header. if you need it, refer to it.In the php program, the header information is
The php header is compared with the redirect in asp. Response is used to implement redirection in asp. redirect function: Usage example: response. redirect .. test. in aspphp, there are also similar functions: header Usage example: header (location :
When we go on page jumps, we usually use
In PHP with the header ("location:test.php") to jump to pay attention to the following points, to help solve some of the problems novice often encountered
1, location and ":" No space between, otherwise it
If you are just beginning to learn PHP, there may be many functions to study, today we will learn how to use the PHP Header (), more instructions, please refer to the PHP Chinese manual, the following is about the Header function detailed use
Objective
This article describes the use of a jump in PHP header("location:test.php") to pay attention to the following points to help solve some novice frequently encountered problems
One, location and ":" No space between the number, or there
Transfer from http://www.jb51.net/article/22501.htm
PHP header to define a PHP page for UTF encoding or GBK encoding
PHP page is UTF encoded
header ("content-type:text/html; Charset=utf-8 ");
PHP page is GBK encoded
header
In php, headerinclude is used for header redirection to solve the problem of parameter loss. In php, header redirection uses include to solve the problem of parameter loss. some colleagues in headerinclude reported that some recently launched games
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.