Html elements in php

Source: Internet
Author: User
Let's take a look at the following code form2.phphtmlheadtitlegreetinseartylingtitleheadbodyformactionformprocess2. phpmethodposttabletrtdnametdtdinputtypetextnamenametdtrtrtdgreetingstdtdselectn

Let's take a look at the following code form2.php html head title greetins eartyling/title/head body form action = "formprocess2.php" method = "post" table tr td Name/td input type = "text" name = "name" // td/tr td Greetings/td select name = "gr

Let's take a look at the following code.

Form2.php

 greetins eartyling 
     
  
 
Name
Greetings Hello Hola Bonjour
Display Debug info

Formprocess2.php

            Greeting earthing            
 Degut:';        print_r($_POST);        echo '
';}?>

Select the checkbox "Display Debug info" and click "submit" to Display the following content:

Bonjour, who!
Degut:Array ([name] => who and who [greeting] => Bonjour [debug] => on [submit] => Submit)

We can see that the value of the input element can be obtained using the $ _ POST ("name") function, not just a text box, but a single-statement checkbox and a drop-down list box select, note that here, if the checkbox value is "on", it is not true, and if we do not select the checkbox, use $ _ POST ("debug") to obtain the checkbox value, an error is returned, because the $ _ POST array does not contain this element.

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.