Usage of phpheader functions
- If (true)
- {
- Header ('Location: http://bbs.it-home.org ');
- }
- File_put_contents('test.txt ',' OK '); // A test.txt file is generated, and the file content is OK.
In this code, careless programmers will think the header ('Location: http://bbs.it-home.org '); over, in fact, the background code is still executed, so use header (location) whether it is encapsulated in another function or written directly, we recommend that you add exit () to the end to confirm that the program is suspended. >>> Articles you may be interested in: php header () simple example of a function php header function implements object download instance code example of header function usage in php detailed example of php header usage detailed instructions php header function file download directly prompts saved code php header information application example php file header) PHP header () function usage details HEADER messages in PHP >>> |