PHP Gets the method with & value in the URL parameter

Source: Internet
Author: User

You will often encounter a path to get the previous page address. You can go back to use, to achieve this is through JS to operate, the following has a good example, you can refer to the next

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

The code is 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.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.