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

PHP implementation when clicking different submit buttons

墨辰丷
Release: 2023-03-30 10:10:01
Original
2333 people have browsed it

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>  
 ?>
Copy after login

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!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template