Simple computing and simple computing functions

Source: Internet
Author: User

Simple computing and simple computing functions

To do the above, we need to have a simple understanding of the elements of the hidden form.

The syntax format of the element to hide a form is <input type = "hidden" value = *>. The function is to prevent the browser from displaying this form field element when browsing a webpage, however, when you submit a form, you can hide the name attribute of the form element.

And value attribute values are sent to the server.

<? Php $ CFQ = $ _ POST ["tag"]; // determines whether the user has clicked the computing button if ($ CFQ = 1) {$ addnum1 = $ _ POST ["addnum1"]; // you can use the $ _ POST built-in array to obtain the increment value. $ addnum2 = $ _ POST ["addnum2"];} else {$ addnum1 = $ addnum2 = 0;} $ sum = $ addnum1 + $ addnum2;?> Enter two integers in the form: <form name = "form1" method = "post" action = "#"> <input type = "hidden" name = "tag" size = "4 "value =" 1 "> <! -- Value is used for Equality judgment --> <input type = "text" name = "addnum1" size = "4" value = "<? Php echo $ addnum1;?> "> + <Input type =" text "name =" addnum2 "size =" 4 "value =" <? Php echo $ addnum2;?> ">=<? Php echo $ sum;?> <Br> <! -- Output calculation result --> <br> <input type = "submit" name = "Submit" value = "calculation"> <input type = "reset" name = "Submit" value = "reset"> </form>

 

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.