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>