Php uses the hidden form control to obtain the url of the first two pages. form url_PHP tutorial-php Tutorial

Source: Internet
Author: User
Php uses the hidden form control to obtain the url and form url of the first two pages. Php uses the hidden form control to obtain the URLs of the first two pages. The form url encountered a similar problem during the learning process: for example, the background wanted to be like this: however, php hides the form control to obtain the url of the first two pages.

I encountered a similar problem during my learning process:
For example, the background is intended to be like this:

However, it is actually like this:

Solution:
Hide form controls

 

In this way, the value of $ _ SERVER ['http _ referer'] seems to be saved to $ _ POST [prevurl] temporarily.

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.

In subsequent development, the new article will have a select Tag. if you enable the select tag disabled, the selected value cannot be post, so I used the den spoofing method again and submitted it in the dark.


How can I obtain the URL of the submitted page through php?

PHP $ _ SERVER ['http _ referer']
Use $ _ SERVER ['http _ referer'] to easily get the address of the previous page linked to the current page.
$ _ SERVER ['http _ referer'] is valid only for pages accessed through </a> hyperlinks and POST or GET forms.

PHP uses URL to pass variables. can I submit a variable without using a form?

Except for images, you can use URLs to pass variables.
The method is as follows: a. php? A = 123
Use $ _ GET ['A'] to output
Can I use a. php? A = 123 & B = 456 & c = 789
Echo $ _ GET ['A'] 123 echo $ _ GET ['B'] 456
Write a function to filter out the best variables to ensure the security of the webpage.
In fact, if GET is used, you can use post to get the values in the form. if not, you can check whether the post and GET settings are opened.

I encountered a similar problem during my learning process: for example, I wanted to make it in the background: but in reality, I...

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.