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 |
<?php |
$action = $HTTP_POST_VARS [ "mySubmit" ]; |
switch ( $action ) { |
case "添加" : |
//省略代码 |
break ; |
case "修改" : |
//略 |
break ; |
case "删除" : |
//略 |
break ; |
} |
?> |
初级程序员
by: 我的程序员之路 发表于:2013-05-05 20:12:30 顶(1) | 踩(0) 回复
初学PHP,原来这样也可以,学习了
网友回复
回复小蜜锋 : 呵呵,我也觉得太神奇了!
顶(2) 踩(1) 2013-05-17 23:16:23
小蜜锋 : 因此必须要马克!
顶(1) 踩(0) 2013-05-17 23:16:42
回复评论