how to get the url of the current page using php

get, php, url

Solution

<?php
    $url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    echo $url;
?>

Problem

Possible Duplicate: How do I get current page full URL in PHP How 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

Original source

Related problems