Home >Backend Development >PHP Problem >How to pass value using a tag in php page

How to pass value using a tag in php page

L
LOriginal
2020-06-01 14:20:035783browse

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[&#39;act&#39;]) && trim( $_GET[&#39;act&#39;] )== &#39;showcart&#39;){
echo &#39;a传值成功了&#39;;
}

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!

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