+ Reply to Thread
Results 1 to 8 of 8

Thread: Check your IP

  1. #1
    Jaan Guest

    Check your IP

    Well this is simple trick. Well i can't say it's a trick but.. well..

    The way you see your IP

    Code:
    <?php
    echo $_SERVER['REMOTE_ADDR'];
    ?>
    Last edited by Jaan; 01-17-2008 at 06:45 AM.

  2. CODECALL Circuit advertisement

     
  3. #2
    twalters84 is offline Learning Programmer
    Join Date
    Oct 2007
    Posts
    57
    Rep Power
    0
    Hey there,

    Instead of outputting the IP address, you could store it in a variable and then get the hostname of the user.

    Code:
    <?php
    $hostname 
    gethostbyaddr($_GET['ipAddress']);
    echo 
    $hostname;
    ?>
    I had to use this on my coldfusion server because the host blocked the Java(CreateObject) method.

    Sincerely,
    Travis Walters
    spammy sig deleted

  4. #3
    Jaan Guest
    Quote Originally Posted by twalters84 View Post
    Hey there,

    Instead of outputting the IP address, you could store it in a variable and then get the hostname of the user.

    Code:
    <?php
    $hostname 
    gethostbyaddr($_GET['ipAddress']);
    echo 
    $hostname;
    ?>
    I had to use this on my coldfusion server because the host blocked the Java(CreateObject) method.

    Sincerely,
    Travis Walters
    Well yea you can try it.. but it don't work always

  5. #4
    PlayaSkater's Avatar
    PlayaSkater is offline Learning Programmer
    Join Date
    Aug 2007
    Location
    Cruzer, US
    Posts
    64
    Rep Power
    0
    What's the JavaScript method?

  6. #5
    Jaan Guest
    HTML Code:
    <html>
    <head>
    <script language="JavaScript">
    function disp_ip(){
    var ip = '<!--#echo var="REMOTE_ADDR"-->';
    document.write(ip)
    }
    </script>
    </head>
    <body>
    <form>
    <input type='button' value='Check your Ip' onClick='disp_ip();'>
    </form>
    </body>
    </html>
    But you have to use .shtml extension not .html or .htm because it uses server side includes

  7. #6
    PlayaSkater's Avatar
    PlayaSkater is offline Learning Programmer
    Join Date
    Aug 2007
    Location
    Cruzer, US
    Posts
    64
    Rep Power
    0
    Thanks bro, you're awesome. How long have you been programming?

  8. #7
    Jaan Guest
    np mate..
    umm.. i think umm.. maybe 2,5 years for now

  9. #8
    deny is offline Newbie
    Join Date
    Oct 2007
    Location
    Find-Ip-Address.org
    Posts
    13
    Rep Power
    0
    Quote Originally Posted by Jaan View Post
    Well yea you can try it.. but it don't work always
    If there is not any host name it will not works. Otherwise it will display host address.
    So you can use both code!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Check this out!
    By Scott in forum The Lounge
    Replies: 7
    Last Post: 05-09-2010, 10:03 AM
  2. Could someone check this?
    By Alex_j in forum C# Programming
    Replies: 1
    Last Post: 05-05-2010, 12:40 PM
  3. How to check if a check box has changed?
    By Peckerfish in forum C# Programming
    Replies: 2
    Last Post: 05-24-2009, 02:22 PM
  4. Check your IP
    By Jaan in forum JavaScript Tutorials
    Replies: 6
    Last Post: 05-28-2008, 01:10 PM
  5. Check ISO with CD
    By TcM in forum Computer Software/OS
    Replies: 3
    Last Post: 12-21-2007, 06:20 AM

Tags for this Thread

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