How To Get The Client Network?

Discussion in 'PHP' started by clix99, Jan 27, 2013.

  1. #1
    Hi,

    I did a lot of digging and still can't figure out how to get my visitors "network". On Google analytics I can see this data easily (under audience) but I would like to get it with PHP and save it to myqsl database.

    Can anyone share your experience on how to get this data?
    Thanks
     
    clix99, Jan 27, 2013 IP
  2. Ratty

    Ratty Active Member

    Messages:
    565
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    95
    Digital Goods:
    1
    #2
    Ratty, Jan 27, 2013 IP
  3. clix99

    clix99 Well-Known Member

    Messages:
    133
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    116
    #3
    No I don't mean the IP of the user,

    If you go to Google analytics Audience > Technology > Network you'll see what I mean.

    Anyone?
     
    clix99, Jan 27, 2013 IP
  4. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #4
    Why don't you post exactly what you mean instead of making us guess? If it's as easy as going to Google Analytics, go there, copy what you're talking about and paste it here.
     
    Rukbat, Jan 27, 2013 IP
  5. clix99

    clix99 Well-Known Member

    Messages:
    133
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    116
    #5
    Ok, After more digging I understand that google analytics determines the network of the user by analyzing the IP with a vast database they have.

    Slightly different question:
    I would like to know how to get the user's hostname - I have Webalizer on my cpanel and I can see the "hostnames" for visits, for example here are 3 hostnames:

    cpc8-enfi16-2-0-cust29.hari.cable.virginmedia.com
    107-0-27-252-ip-static.hfc.comcastbusiness.net
    h69-21-50-190.mdtapa.dsl.dynamic.tds.net

    Any idea how to get this data with PHP?

    Thanks
     
    Last edited: Jan 28, 2013
    clix99, Jan 28, 2013 IP
  6. clix99

    clix99 Well-Known Member

    Messages:
    133
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    116
    #6
    Solved:

    <?php
    $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
     
    echo $hostname;
    ?>
    PHP:
     
    clix99, Jan 28, 2013 IP
  7. ezprint2008

    ezprint2008 Well-Known Member

    Messages:
    611
    Likes Received:
    15
    Best Answers:
    2
    Trophy Points:
    140
    Digital Goods:
    1
    #7
    If you would've read the page he gave you on IP, Servers,etc you'd see its more than only IPs but can also tell you their server/hostname..and even which websites they came from to get to your site.
    If you are making analytic script you probably want all of the information. $_SERVER var is what you will inevitably need for all of what you ask so save you time on coming back and posting your next question.
     
    ezprint2008, Jan 28, 2013 IP