php after landing to jump to the front page, the use of $_server global variables can achieve this function, the following has a good example, I hope to help you.
Recently hand a small project let me contact with PHP programming, simple landing function has been OK. But in actual use when found a problem: User A To send a link to the user B,b open page prompts landing, but after the successful landing, but jump to the home page, not a send link. In order to have a better user experience, B Landing after the successful should automatically jump to the link before landing. Check the PHP help manual and use $_server global variables to achieve this functionality. $_server is a super global variable for PHP, the detailed explanation of $_server variable can be referenced as follows: http://www.php.net/manual/zh/ The reserved.variables.server.php Implementation method is: When prompts the user to log in, in the session or the Cookie records the request page the URL, after the login authentication succeeds jumps back to this URL. checklogin.php code as follows: Session_Start (); if (!isset ($_session[' LOGIN_OK ')) { echo " <script Language=javascript>alert (' the page to be accessed needs to be logged in first. ');</script> "; $_session[' userurl '] = $_server[' Request_uri ']; echo ' <script language= javascript>window.location.href= "login.php" </script> '; } login.php code is as follows: Session_ Start (); //Here omit account password Verification code, verify OK and execute the following code if (isset ($_session[' Userurl ')) { // There are pages to jump $url = $_session[' Userurl ']; } else //No page to jump, then go to home $url = "{ "; }&NBSP //0.5s after jump echo "<meta http-equiv=" Refresh "content=" 0.5;url= $url ">";