这部分如何变化到跨度?使用相同的指令添加一个
<input type="hidden" name="res1" value="the same value you put in the span"/>
然后,在您的 PHP 代码中,您可以使用$_REQUEST['res1']或$_POST['res1']-- 注意删除的哈希值来获取值。
更新
对于任何可能犯类似错误的人,这里是什么可行,什么不可行。
HTML 表单仅在提交时发送表单控件的值。他们是:
inputs of various types (text, password, radio, checkbox, hidden, file, submit, image, or newer HTML5 inputs like email, etc.)
selects
textareas
Furthermore, the value of an input is only submitted if it has been assigned a name. So if the following inputs are in a form, on submitting the form whatever value bugs may have will be submitted, but nothing will be submitted for bunny:
<input type="text" name="bugs"/>
<input type="text" id="bunny"/>
So, putting any element between <form> ... </form> does not cause the text inside it to be submitted. For a value to be submitted it should be one of the above form controls AND it should have a name property set.