#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    2
    Rep Power
    0
    I'm setting up a system that uses PHP
    and MySQL. Whenever a user enters some
    data that get stored as a row in the
    database, I would like to capture the
    IP addr of the user's computer, and put
    that in the row, too. Is the IP addr
    of the browser set as a PHP variable,
    or is there some way to access that in
    PHP? This would be valuable for security,
    so that, for instance, if a hacker is
    launching some attacks from one particular
    host, that will be easier to trace.

    Thanks.
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    You can get the remote address using

    $REMOTE_ADDR variable.


    eg:

    <?php
    print $REMOTE_ADDR;
    ?>

    ---- or -------

    you may use getenv() function for getting the value of an environment variable.

    $ip_addr = getenv("REMOTE_ADDR");


    ------------------
    SR -
    shiju.dreamcenter.net

    "I will love thee, O Lord,my strength"


    [This message has been edited by Shiju Rajan (edited May 10, 2000).]

Similar Threads

  1. Testing in older browsers
    By Eternal Student in forum HTML Programming
    Replies: 4
    Last Post: December 11th, 2003, 04:57 AM
  2. Odd problem with headers vs. browsers and firewall
    By stipey in forum PHP Development
    Replies: 0
    Last Post: August 7th, 2003, 01:10 PM
  3. PHP and older browsers
    By TwylaB in forum PHP Development
    Replies: 2
    Last Post: May 27th, 2003, 09:27 PM
  4. weird problem w/ FormMail.php and certain browsers
    By heliosweb in forum PHP Development
    Replies: 5
    Last Post: December 10th, 2001, 05:17 PM
  5. Older copies of the major browsers (IE and NS)
    By curmudgeon42 in forum HTML Programming
    Replies: 6
    Last Post: February 13th, 2001, 01:29 PM

IMN logo majestic logo threadwatch logo seochat tools logo