Embed Get Current URL

There is much I could say to preface this question, but I’ll hold my thoughts for now.

Scenario : I developed a flv player that I’m allowing others to embed on their sites, however I’d like to display the url information of their site in the player and use this even as a tracking method (so I can find out who’s using it).

**Problem **: I can’t require and/or depend on people using php on their page or passing the appropriate variables via embed tags. Therefore, I thought, "well I could just use a call to a php file using the following : "


 <?PHP
echo "<connectionInfo ip='".$_SERVER['REMOTE_ADDR']."' ref='".$_SERVER['HTTP_REFERER']."' uri='".$_SERVER['REQUEST_URI']."' urlfull='".curPageURL()."' domain='".$_SERVER['SERVER_NAME']."' lang='".$_SERVER['HTTP_ACCEPT_LANGUAGE']."' usragent='".htmlspecialchars($_SERVER['HTTP_USER_AGENT'],ENT_QUOTES)."' />";

function curPageURL() {
$isHTTPS = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on");
$port = (isset($_SERVER["SERVER_PORT"]) && ((!$isHTTPS && $_SERVER["SERVER_PORT"] != "80") || ($isHTTPS && $_SERVER["SERVER_PORT"] != "443")));
$port = ($port) ? ':'.$_SERVER["SERVER_PORT"] : '';
$url = ($isHTTPS ? 'https://' : 'http://').$_SERVER["SERVER_NAME"].$port.$_SERVER["REQUEST_URI"];
return $url;
}
function curPageName() {
 return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
}

?> 

However, it doesn’t get the information of the other site just the information of the php. Normally, that script works just fine, but in this case not even the ref get’s what is needed.

<?> Any ideas? <?>