一样呀.
if($_REQUEST("submit")=="按钮1")
{
执行什么
}
if($_REQUEST("submit")=="按钮1")
{
执行什么
}
解决方案 »
- 弱弱问一句 memcache 存的信息满了会怎样 ?
- thinkphp用import引入的文件,没有办法读取
- flush 与 ob_flush 有什么区别啊
- 在http://219.19.20.18/index.php中能否判断出是租的空间 或 主机托管 或 拉的专线?
- PHP获取自身实例的意义
- 问问高手一个关于smarty问题
- 重庆的用PHP做网站的高手请进!
- symfony使用clear-cache没反应
- 那个函数可以扑捉用户对网页的刷新????
- 用com 访问数据库
- 各位好,请问怎样表存储在ORACLE中(字段类型为BLOB)的EXCEL文件内容取出?急。。。
- 在 pws 下我能用php_gd.dll中的圖像函數,但在 apache 下不能用,我還要注意那些設置???
根据值的不同采取不同动作就是了。
比如:
file1.php
<form action="file2.php" method="post">
<input type="text" name="ok">
<input type="submit" name="mySubmit" value="添加">
<input type="submit" name="mySubmit" value="修改">
<input type="submit" name="mySubmit" value="删除">
</form>file2.php
<?
$action = $HTTP_POST_VARS["mySubmit"];
switch ($action)
{
case "添加":
//省略代码
break;
case "修改":
//略
break;
case "删除":
//略
break;
}
?>
file1.php
<script>
add()
{
document.all.item("action")="add";
...
其它语句,比如校验之类
...
document.all.item("form1").submit();
}
del()
{
document.all.item("action")="del";
...
其它语句,比如校验之类
...
document.all.item("form1").submit();
}
modify()
{
document.all.item("action")="modify";
...
其它语句,比如校验之类
...
document.all.item("form1").submit();
}
</script>
<form id=form1 method=post action=file2.php>
<input name=submitbutton type=button value=添加 onclick=add() />
<input name=submitbutton type=button value=删除 onclick=del() />
<input name=submitbutton type=button value=更新 onclick=modify()/>
<input name=action type=hidden value="" />
</form>file2.php
<?
switch($HTTP_POST_VARS['action'])
{
'add':
...
break;
'del':
...
break;
'modify':
...
break;
default:
...
}
?>