You need the protocol, the host name and the (root relative) request URL. Then stick them together:
$scheme="http" . ( is_ssl() ? '' : 's' ) . '://';
$url = $scheme . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
You need the protocol, the host name and the (root relative) request URL. Then stick them together:
$scheme="http" . ( is_ssl() ? '' : 's' ) . '://';
$url = $scheme . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];