Results 1 to 2 of 2

Thread: $_SERVER['REMOTE_ADDR'], << need help with!

  1. #1
    Join Date
    Mar 2008
    Posts
    122
    Thanks
    17
    Thanked 5 Times in 5 Posts

    Unhappy $_SERVER['REMOTE_ADDR'], << need help with!

    Hi, on my webpage i have a guestbook, and i have this code:

    PHP Code:
    <?php
    function ip() {
    $ip split('[.]'$_SERVER['REMOTE_ADDR']);
    echo 
    'IP: '.$ip[0].'.'.$ip[1].'.x.x';
    }
    ?>
    so it outputs as:

    123.456.x.x ( not revealing the whole i.p ),

    but my problem is that it only shows your ip on every post!, an i was wondering how would show the indivual user ip's, thanks for any help i get.

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    you would need to save the ip address in the db when the user posts, then call that column from the db into the split function.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

Bookmarks

Posting Permissions

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