Correct syntax for hyperlink URL with PHP $_GET(使用 PHP $_GET 修正超链接 URL 的语法)
问题描述
我想知道如何将来自我网站的信息放入我网站第一页的 URL 中,然后在下一页上,使用 $_GET
从 URL 获取变量.
I am wondering how I would put information from my website in the URL on the first page of my site, and then on the next page, use $_GET
to get the variables from the URL.
我只是想把它放在一个像 <a href="mywebsite.com/page?name=$name"></a>
这样的链接里,如果我就是这样做的,如果可以,我将如何从 URL 中获取它?
I was just wanting to put it in a link like <a href="mywebsite.com/page?name=$name"></a>
So would it work if I did it like that, and if it would, how would I get it from the URL?
推荐答案
do
<a href="http://mywebsite.com/page?name=<?php echo $name; ?>"></a>
在您的页面中,您可以将名称设为:
And in your page, you could get the name as:
$name = $_GET['name'];
这篇关于使用 PHP $_GET 修正超链接 URL 的语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 PHP $_GET 修正超链接 URL 的语法


基础教程推荐
- PHP 守护进程/worker 环境 2022-01-01
- phpmyadmin 错误“#1062 - 密钥 1 的重复条目‘1’" 2022-01-01
- 找不到类“AppHttpControllersDB",我也无法使用新模型 2022-01-01
- 如何在 XAMPP 上启用 mysqli? 2021-01-01
- HTTP 与 FTP 上传 2021-01-01
- 使用 PDO 转义列名 2021-01-01
- 在 CakePHP 2.0 中使用 Html Helper 时未定义的变量 2021-01-01
- Doctrine 2 - 在多对多关系中记录更改 2022-01-01
- 在 yii2 中迁移时出现异常“找不到驱动程序" 2022-01-01
- 如何在 Symfony 和 Doctrine 中实现多对多和一对多? 2022-01-01