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
Release: 2023-03-01 10:32:01
Original
5835 people have browsed it

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

php:

if( isset($_GET[&#39;act&#39;]) && trim( $_GET[&#39;act&#39;] )== &#39;showcart&#39;){
echo &#39;a传值成功了&#39;;
}
Copy after login

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!

Related labels:
php
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template