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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Sep 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool getting client's IP address

    Hi!
    how can i get the IP adress of a visiting user to my website?

    'til now i've got this lines of code, but it doesn't work :[

    -------------------------------------------

    var ip ='<!--#echo var="REMOTE_ADDR"-->';
    alert("Hello "+ip);

    -------------------------------------------
    the output is: Hello <!--#echo var="REMOTE_ADDR"--> . Can anyone speak up for me what's happening since i'm a newbbie in this javascipting thing?
    thanks in advance.
    Bruno.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That is a Server Side Include (SSI) which gives the IP address, you've got to have a web host that supports SSIs and name your web page with the appropriate extension to make your web server check for SSI code in your page.

    There is no way to get the IP address directly using javascript unless your target audience is running the Netscape 4.x series of browser (unlikely).
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #3
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool name that method for 10

    Quote Originally Posted by Roy Sinclair
    There is no way to get the IP address directly using javascript unless your target audience is running the Netscape 4.x series of browser (unlikely).
    outta interest, what was the method for that. believe it or not, i'm kinda feeling nostalgic for that old heap of @#*$& LOL - it did have some interesting features!
    *keep it simple (TM)

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    http://javascript.internet.com/user-...ip-filter.html -- Even NS 4 had to use a Java applet.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #5
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Roy
    Even NS 4 had to use a Java applet.
    that's not bad. presumably that can still be used in any modern browser though, providing Java is installed and enabled, of course.
    Last edited by jbot; 09-28-2004 at 11:51 AM. Reason: typo
    *keep it simple (TM)


  •  

    Posting Permissions

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