finance-business.org
Member
Posted 1 year ago #
I am trying to add current URL to my affiliate links to track profiles dynamically.
Anyone know what is the PHP code for the current URL? I Just need to add the PHP without spaces at the end of the affiliate link in my sidebar.php.
I appreciate your assistance.
Place this bit of PHP anywhere above the link:
$current_url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
Then put this bit into your link where you want your current web address:
<?php echo $current_url; ?>