how to get the url of the current page using php
16,682
<?php
$url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
echo $url;
?>
Author by
user1373168
Updated on June 04, 2022Comments
-
user1373168 almost 2 years
Possible Duplicate:
How do I get current page full URL in PHPHow can i get url of the current page using php? Is there any such php function?
What i want to achieve is:
- Somehow get the url of the current page
- check if the url is equal to some preset value
- if it is equal then echo something else echo something else