PHP server page jump implementation method. (Note that the client jump is not implemented using headers, js, and other methods.) The Copy code is as follows: functionserver_transfer ($ dest) {global ...; the variables on the current page that you want to use on the new page or (note that the client jump is not implemented using headers, js, and other methods)
The code is as follows:
Function server_transfer ($ dest)
{
Global...; // list the variables on the current page or custom global variables you want to use on the new page.
Include $ dest; // run the new script
Exit; // exit the script
}
Note:
1. if any data output before the jump is displayed on the new page, it can be cleared before the jump unless the ob_start buffer is used. this will not affect each other.
2. because the new page runs in a custom function scope, the variables defined on this page will not affect the new page. this is both a benefit and a disadvantage.
3. on the new page, you can still use Super global variables such as $ _ POST to access the variables originally on this page. note the need to write code.
4. to repeat the content of this page and the new page, if both pages contain the same page, such as the header and footer, use require_once.
All in all, the jump can be done, but the programmer must know what happened, otherwise it is easy to get some strange results.
Http://www.bkjia.com/PHPjc/325778.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/325778.htmlTechArticle (do not use header, js and other methods to do the client jump) code is as follows: function server_transfer ($ dest) {global ...; // Set the variables on the current page or...