Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question finding user latency

    hi guys
    so i found out the code to get users ip and resolve the ip to a dns also

    now does some one have a script to find out user latency?
    anyone

    latency or rtt

    -----------
    to get some one Ip address
    and resolve the dns name i use this

    Code:
    if (getenv('HTTP_CLIENT_IP')) {
    $IP = getenv('HTTP_CLIENT_IP');
    }
    elseif (getenv('HTTP_X_FORWARDED_FOR')) {
    $IP = getenv('HTTP_X_FORWARDED_FOR');
    }
    elseif (getenv('HTTP_X_FORWARDED')) {
    $IP = getenv('HTTP_X_FORWARDED');
    }
    elseif (getenv('HTTP_FORWARDED_FOR')) {
    $IP = getenv('HTTP_FORWARDED_FOR');
    }
    elseif (getenv('HTTP_FORWARDED')) {
    $IP = getenv('HTTP_FORWARDED');
    }
    else {
    $IP = $_SERVER['REMOTE_ADDR'];
    }
    	
    $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
    												
    echo $_SERVER['REMOTE_ADDR'];
    
    echo $hostname;
    
    
    echo $IP;

  • #2
    Regular Coder
    Join Date
    Sep 2005
    Posts
    394
    Thanks
    1
    Thanked 0 Times in 0 Posts
    You could theoretically ping them and get the response time however many people have incoming ICMP trafic disabled.

    ~Phil~

  • #3
    New Coder
    Join Date
    Jan 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    do you have a code to ping them and get the time back
    response ?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •