Tuesday, May 29, 2012

How to get full url of website uing php

$protocol = $_SERVER['HTTPS'] == 'on' ? 'https' : 'http';
$url = $protocol.'://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; //  More efficient manner
echo $url;

No comments:

Post a Comment