Get the full URL of current page using PHP

You can use this PHP code snippet to get the full URL of current page.


									<?php

$currentURL = (isset($_SERVER["HTTPS"]) ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . $_SERVER["REQUEST_URI"];

// Example:
echo $currentURL;

?>
								

ignite.coder

Between two evils, I always pick the one I never tried before.

Comments (0)

No Comments Yet.