What are some best practices for passing variables through normal links in PHP?

When passing variables through normal links in PHP, it is best practice to use query parameters in the URL. This allows you to easily retrieve the variables on the receiving page using the $_GET superglobal array. To pass variables through links, you can simply append them to the URL as query parameters.

// Link with variable passed as query parameter
<a href="page2.php?variable=value">Link to Page 2</a>

// Retrieving the variable on page2.php
$variable = $_GET['variable'];
echo $variable;