Correct syntax for hyperlink URL with PHP $_GET

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.

I was just wanting to put it in a link like <a href="$name" rel="nofollow noreferrer noopener"></a> So would it work if I did it like that, and if it would, how would I get it from the URL?

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

Example Link:

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

For more information on $_GET look at

Solution 2


<a href="<?php echo $name; ?>" rel="nofollow noreferrer noopener"></a>

And in your page, you could get the name as:

$name = $_GET['name'];

Solution 3

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


Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply