从脚本使用中获取URL

So i'm writing a script in PHP which generates a image so other people can use it too. But is it possible to get the url's on the pages the scripts are used ?

For example. http://www.johnexample.com is using my image with this format

<img src="http://www.myurl.com/image.php">

Now i wan't to receive the url of http://www.johnexample.com without GET variables if possible.

It's basically a script that's suppose to track/note down all the websites that are using my image.

At first i though it was possible with this:

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

But that only get's the location of the script itself. Thanks

Oh, that was simpler than i though. Got it working like this now.

The page with the tag only has to load once and it will save. Only using Session now because it's being tested local. Gonna switch it over to a database.

Thanks guys

<?php
session_start();
$url = $_SERVER["HTTP_REFERER"];

if(!strpos($_SESSION["url"], $url)) {   
    if($url != '') {
        $_SESSION["url"] = $_SESSION["url"] . "," . $url;
    } 
}


$tracker = explode(",", $_SESSION["url"]);

var_dump($tracker);

?>