?php
$request_url = “http://{$_SERVER[‘HTTP_HOST’]}{$_SERVER[‘REQUEST_URI’]}”;
echo $request_url;
?>
Read More: https://realprogrammer.in/current-url-fetch-in-php/
?php
$request_url = “http://{$_SERVER[‘HTTP_HOST’]}{$_SERVER[‘REQUEST_URI’]}”;
echo $request_url;
?>
Read More: https://realprogrammer.in/current-url-fetch-in-php/
For further actions, you may consider blocking this person and/or reporting abuse
Sospeter Mongare -
Segun Olaiya -
M Mainul Hasan -
Danil Khaliullin -
Top comments (1)
Here is a better one with dynamic protocol for site name
<?php
$requestUrl = $_SERVER['REQUEST_URI'];
$siteName = $_SERVER['SERVER_NAME'];
$siteAddr = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https://" : "http://") . $siteName;
?>