Header jump in PHP using include includes solving parameter loss issues
Problems encountered in a project, when the user login success, with the header to jump to the homepage, has been wrong, can not jump to the page you want. Finally Niang a long time to find a solution, here to share to you.
Some colleagues reflect that recently launched several games overseas registration can not be loaded in style files, need urgent repair.
The registration procedure unifies the single entrance, the core judgment is the Checkip place, only needs to make a game_id judgment in the non-real-name authentication template procedure. Because too sure, anxious to get off the psychology, coupled with the tension of everyone urged, all of a sudden, and made two mistakes: one is the game_id of the judgment position ahead of time, resulting in a lot of variables are not uploaded to the destination page, the second is not understand the header jump and include the meaning Direct use of the header to do the jump.
After the header jumps the page, cannot inherit the previous page the variable and so on the element, illustrates:
a.php file
?
1 2 3 4 5 6 7 |
$userEname = "Crystal"; $userCname = "Regulation regulation"; Your code ................................ Header ("location:b.php"); Your code .................. |
If you refer to $userename in the b.php file, what do you guess the result is? $userename = null at this time. If you include b.php with include, you can avoid the problem of empty $userename.
The above mentioned is the whole content of this article, I hope you can like.
http://www.bkjia.com/PHPjc/996759.html www.bkjia.com true http://www.bkjia.com/PHPjc/996759.html techarticle PHP header jump use include to solve the problem of missing parameters in a project, when the user login success, with the header to jump to the first page, has been wrong, can not jump to ...