Home >Backend Development >PHP Problem >How to get the URLs of the first two pages by hiding form controls in PHP?

How to get the URLs of the first two pages by hiding form controls in PHP?

coldplay.xixi
coldplay.xixiOriginal
2020-07-23 16:39:402924browse

php method to obtain the URLs of the first two pages by hiding the form control: post the previous URL to elsewhere through the post method, the code is [

How to obtain the URLs of the first two pages by hiding the form control:

By hiding the form control

<input type="hidden" name="prevurl" value="<?php echo $_SERVER[&#39;HTTP_REFERER&#39;]?>">

This way the value of $_SERVER['HTTP_REFERER'] seems to be temporarily saved to$_POST[prevurl]里.

In fact, the principle of this method is to post the previous URL to another place through the post method, but this post is the current page only

In the subsequent development, there will be a select tag in the new article part. If the select tag is disabled, the selected value will not be posted, so I once again used the hidden deception method and submitted it secretly. , tried and tested.

Related learning recommendations: PHP programming from entry to proficiency

The above is the detailed content of How to get the URLs of the first two pages by hiding form controls in PHP?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn