Interaction between PHP and HTML

Source: Internet
Author: User
HTML form preface: HTMLHTML (HTMLtag ). To some extent, Html document img, html link a, html title h, and so on. The specific image size and title Font are provided in the form of attributes. HTML form (used to collect different types of user input) htmlinput inputs data to the html page. The input type is composed of class

HTML (HTMLtag ). To some extent, Html document = img, html link a, html title h, and so on. The specific image size and title Font are provided in the form of attributes. HTML form (used to collect different types of user input) htmlinput inputs data to the html page. The input type is composed of class

HTMLForm

Preface:HTML (HTML tag ). To some extent, Html document ==, html link, html title And so on. The specific image size and title Font are provided in the form of attributes.

HTML form (used to collect different types of user input)

HtmlInput data to the html page. The input type is defined by the type attribute.

Input

Action and confirmation buttons of the form

When you click the OK button, the content of the form is transmitted to another file. The action attribute of the form defines the object name of the target file. The file defined by the Action property usually processes the received input data.

 

After you click submit, the value in the form will be passed to the $ _ GET variable, which is an array. The name attribute of the text field is the key value of the array, and value is the content of the array.

 

If you click "Submit", the input is sent to a new page named html_form_action.asp.

Interaction between PHP and HTML


PHP super global variables $ _ GET and $ _ POST are used to collect form data)

// Html code

// Php codeWelcome
 
Your email address is:

_ GET or _ POST

Both GET and POST create arrays (for example, array (key => value, key2 => value2, key3 => value3 ,...)). This array contains key/value pairs, where the key is the name of the Form Control and the value is from the user's input data.

GET and POST are treated as $ _ GET and $ _ POST. They are super global variables, which means that access to them does not require scope-you do not need any special code, and you can access them from any function, class, or file.

$ _ GET is the variable array passed to the current script through URL parameters. (Visible to anyone, the parameter appears in the url, which is not secure)

$ _ POST is an array of variables passed to the current script through http post. (Invisible and secure)

Programmer preference _ POST

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.