Actually in the course of the project, we often encounter the path to get the previous page address. You can go back to the previous page using
Copy Code code as follows:
<script>window.history.go ( -1);</script>
This is done through JS.
If there is such a scenario, when the user needs to exit the account, you want him to exit directly after returning to the current page
For example, the address for the current page is http://xxx/module.php?module=groupbook&view=index&id=2.
You exit the system presumably will use $_server[' Request_uri ' to get the current path, and then the value as a parameter to exit the need to return the path, this time you find
He only acquired Http://xxx/module.php?module=groupbook but did not get &view=index&id=2, which means that the address we returned after we withdrew became
Http://xxx/module.php?module=groupbook (This is supposed to be http://xxx/module.php?module=groupbook&view=index&id=2),
This is because he took & as the first parameter, simply understood as
http://xxx/login.php?op=logout&return=http://xxx/module.php?module=groupbook&view=index&id=2,
into a
http://xxx/login.php?op=logout&return=http://xxx/module.php?module=groupbook&view=index&id=2.
This time we need to use the current acquired $_server[' Request_uri ' for transcoding using UrlEncode ($_server[' Request_uri '))
We can solve our problems.