Data interaction between HTML forms and PHP

Source: Internet
Author: User
Tags php development environment
: This article mainly introduces the data interaction between HTML forms and PHP. For more information about PHP tutorials, see. HTML generally interacts with users on the front-end page. you can use PHP to build a server in the backend to process data. Now we can use the front-end form to obtain user input. PHP will process the background and return the information to the user.

(1) to build a PHP environment and server, please refer to my first three articlesBlogHow to Install MacXAMPPEclipse, PHP development environment configuration, and Hello World, the first PHP program.

(2) PHP code implementation:

 Password: ". $ _ GET ['password'];

(3) obtain the link address of the PHP Server, that is, the link address after you run the program. for example, my URL is http: // localhost/MyPHPServer/Server. php.

To access PHP in HTML.

(4) The HTML form code is implemented as follows:

 Form interaction with PHP

(5) then run the HTML code and enter the user name and password.

.

(6) The page will jump to another page. the page information is the data returned by PHP:

.

(7) the communication between HTML and PHP is successful. We can see that we use the GET method for communication, and we can also use POST for communication, as long as the HTML and PHP can be modified at the same time.

The preceding section describes the data interaction between HTML forms and PHP, including the following content. I hope to help anyone who is interested in PHP tutorials.

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.