how to trap client IP address

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shane3341436
    New Member
    • Mar 2007
    • 63

    how to trap client IP address

    I needed to control the client signing in to my site with the aid of their IP address. So, how can the IP address of the client computer can be trapped
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #2
    This is a very simple one to get the client IP address.But I'm not sure about the working condition of this against the firewalls.
    You can find more from here .

    [PHP]<?php
    if (getenv(HTTP_X_ FORWARDED_FOR))
    {
    $domain = getenv(HTTP_X_F ORWARDED_FOR);
    }
    else
    {
    $domain = getenv(REMOTE_A DDR);
    }

    echo $domain;
    ?> [/PHP]

    Comment

    Working...