Home >Backend Development >PHP Tutorial >PHP implementation when clicking different submit buttons

PHP implementation when clicking different submit buttons

墨辰丷
墨辰丷Original
2018-06-06 17:21:492355browse

This article mainly introduces the PHP implementation when clicking different submit buttons. Interested friends can refer to it. I hope it will be helpful to everyone.

PHP method, the code is as follows:

<?php  
 echo "$sub<br>\n";  
 if ("s1"==$sub)  
 {  
  ...  
 }  
 else if ("s2"==$sub)  
 {  
  ...  
 }  
 ?>  
 <html>  
 <head><title></title></head>  
 <body>  
 <form action="<?php print("$PHP_SELF"); ?>" method="get">  
 <input type="submit" name="sub" value="s1">  
 <input type="submit" name="sub" value="s2">  
 </form>  
 </body>  
 </html>  
 ?>

Summary: The above is the entire content of this article, I hope it will be helpful to everyone's learning.

Related recommendations:

How to operate MongoDB with PHP and simple analysis

MSSql operation class encapsulated by PHP and complete example analysis

How to connect php to oracle database and simple analysis

The above is the detailed content of PHP implementation when clicking different submit buttons. For more information, please follow other related articles on the PHP Chinese website!

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