Home >Backend Development >PHP Tutorial >PHP implementation when clicking different submit buttons
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!