<?php


function getServer($param){
    return isset($_SERVER[$param]) ? $_SERVER[$param] : "";
}

print_r(getServer("HTTP_USER_AGENT"));

$connector = getServer("HTTP_REFERER");

if($connector == ""){
    echo "This is True<br/>";
    $connector = getServer("REMOTE_ADDR");
    
    if($connector == "")
        echo "No Chance 1";
}else{
    $connector = parse_url($connector);
    echo "Parse URL: ".print_r($connector, true)."<br/>";
    
    $connector = gethostbyname($connector["host"]);
}

echo $connector;