<input type = "submit " name = "modify " value = "修改 ">
<input type = "submit " name = "delete " value = "删除 ">
这是接收的页面:
if(isset($modify))
{
echo "修改 ";
}
if(isset($delete))
{
echo "删除 ";
}
这是最简单,也是最好的方式
整个交互过程只依赖对submit的命名,而且具有特定意义的命名显得很直观
如果是相同的名字而赋不同的值
<input type = "submit " name = "submit " value = "修改 ">
<input type = "submit " name = "submit " value = "删除 ">
这是接收的页面:
if($submit == "修改 ")
{
echo "修改 ";
}
if($submit == "删除 ")
{
echo "删除 ";
}
也是可以的,但赋值改变时(比如从中文到英文)就需要修改程序了
其他如通过hidden、action都需要用脚本完成,多此一举。要是人家禁用了脚本,你又如何办呢?