Home  >  Article  >  php教程  >  php实现表单多按钮提交action的处理方法

php实现表单多按钮提交action的处理方法

WBOY
WBOYOriginal
2016-06-06 19:40:551276browse

这篇文章主要介绍了php实现表单多按钮提交action的处理方法,需要的朋友可以参考下

表单内有两个提交按钮,要实现当点击不同的提交按钮时,,分别进行两个不同的处理过程,在这里有实现表单多按钮提交action的处理方法分享给大家。

用PHP判断,一个表单两个按钮,按钮的name属性设为相同,但值设为不同,表单提交后,只需要判断提交上来的值就可以转到不同的处理过程去,这个方法比较合理,适合多个按钮在一个表单里。

PHP方法,代码如下:

\n"; if ("s1"==$sub) { ... } else if ("s2"==$sub) { ... } ?>

" method="get">
?>

 以上就是php实现表单多按钮提交action的方法,希望对大家的学习有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn