Correct syntax for hyperlink URL with PHP $_GET

不想你离开。 提交于 2019-11-28 01:37:12

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'];

Example Link: http://example.com/page.php?name=Charles

If you used $_GET["name"] it would return the value Charles

For more information on $_GET look at http://php.net/manual/en/reserved.variables.get.php

the $_GET is the variable. so in this case, to get the name, it would be:

$_GET['name'];
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!