Thursday, October 24, 2013

How to get Current full URL on PHP

If you want to get current page url to do some thing, like if you embed the facebook social comment plugin on dynamic web site you want to declare the comment box commenting url. As this moment you want to get your current page URL dynamically.

You can use following php code to get current url

<?=$current_full_url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";?>

this code will echo the current full url

0 comments:

Post a Comment