I’m trying to make social buttons for my website and I’d like to have it where the buttons automatically use the current URL, no matter what page it is on.
I’ve managed to make the following code with what I’ve looked up (I have very little knowlegde or experience with PHP) :
[php]<?php
$shareUrl = ‘http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]’;
print ‘
Share on Social Media
Facebook
Twitter
Reddit
Tumblr
?>[/php]
This doesn’t work since it doesn’t use the variable that I’ve defined. How can I fix this?