将变量名称传递给php中的表单 [英] Getting variable names passed to form in php
问题描述
如果我有表格:
< FORM ACTION =" test.php">< INPUT TYPE = SUBMIT NAME =" hello"
VALUE ="删除"< / FORM>
然后在test.php我可以写:
$ value = $ _POST [''你好''];
设置$ value ="删除"。
但如果我想要怎么办?得到你好而不是删除。即如何
我可以告诉porm提交中的变量而不仅仅是变量的
值吗?
非常感谢...我是PHP新手,尽管
搜索了一段时间但无法找到这些信息!
If I have a form:
<FORM ACTION="test.php"><INPUT TYPE=SUBMIT NAME="hello"
VALUE="Delete"</FORM>
then in test.php I could write:
$value = $_POST[''hello''];
to set $value="Delete".
But what if I wanted to get "hello" out instead of "Delete". Ie how
can I tell the variables inside the porm submit instead of just the
values of the variables?
Many Thanks... I am new to PHP and can not find this info despite
searching around for a while!
推荐答案
value =
_POST [''hello''];
设置
_POST[''hello''];
to set
value ="删除"。
但如果我想得到你好怎么办呢?而不是删除。即如何
我可以告诉porm提交中的变量而不仅仅是变量的
值吗?
非常感谢...我是PHP的新手,虽然
搜索了一段时间但无法找到这些信息!
value="Delete".
But what if I wanted to get "hello" out instead of "Delete". Ie how
can I tell the variables inside the porm submit instead of just the
values of the variables?
Many Thanks... I am new to PHP and can not find this info despite
searching around for a while!
这篇关于将变量名称传递给php中的表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!