Home > Article > Backend Development > How to pass value using a tag in php page
The value of the a tag in php is generally passed in the get method. The general format is to follow the link address? act=Add the value you want to pass, and then in the PHP processing page, use $_GET['act'] to accept the value passed by a, and then process it. Specific example:
html:
<a href="ucenter.php?act=showcart">我的测试</a>
php:
if( isset($_GET['act']) && trim( $_GET['act'] )== 'showcart'){ echo 'a传值成功了'; }
Recommended tutorial: "PHP Tutorial"
The above is the detailed content of How to pass value using a tag in php page. For more information, please follow other related articles on the PHP Chinese website!