+ Reply to Thread
Results 1 to 8 of 8

Thread: Check your IP

  1. #1
    Moderator Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan's Avatar
    Join Date
    Dec 2006
    Location
    Estonia
    Age
    18
    Posts
    2,055
    Blog Entries
    9

    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 08:45 AM.
    Trill Hosting - Cheap SSL, Cheap Web Hosting, Register Cheap Domains, Cheap Blog Hosting
    www.trillhosting.com | support@trillhosting.com
    Hosting Plans | Write To Us | Support | Client Area | About Us

    CodeCall Blog | CodeCall Wiki

  2. #2
    Learning Programmer twalters84 is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    56
    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

  3. #3
    Moderator Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan's Avatar
    Join Date
    Dec 2006
    Location
    Estonia
    Age
    18
    Posts
    2,055
    Blog Entries
    9
    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
    Trill Hosting - Cheap SSL, Cheap Web Hosting, Register Cheap Domains, Cheap Blog Hosting
    www.trillhosting.com | support@trillhosting.com
    Hosting Plans | Write To Us | Support | Client Area | About Us

    CodeCall Blog | CodeCall Wiki

  4. #4
    Learning Programmer PlayaSkater is an unknown quantity at this point PlayaSkater's Avatar
    Join Date
    Aug 2007
    Location
    Cruzer, US
    Age
    19
    Posts
    64
    What's the JavaScript method?

  5. #5
    Moderator Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan's Avatar
    Join Date
    Dec 2006
    Location
    Estonia
    Age
    18
    Posts
    2,055
    Blog Entries
    9
    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
    Trill Hosting - Cheap SSL, Cheap Web Hosting, Register Cheap Domains, Cheap Blog Hosting
    www.trillhosting.com | support@trillhosting.com
    Hosting Plans | Write To Us | Support | Client Area | About Us

    CodeCall Blog | CodeCall Wiki

  6. #6
    Learning Programmer PlayaSkater is an unknown quantity at this point PlayaSkater's Avatar
    Join Date
    Aug 2007
    Location
    Cruzer, US
    Age
    19
    Posts
    64
    Thanks bro, you're awesome. How long have you been programming?

  7. #7
    Moderator Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan's Avatar
    Join Date
    Dec 2006
    Location
    Estonia
    Age
    18
    Posts
    2,055
    Blog Entries
    9
    np mate..
    umm.. i think umm.. maybe 2,5 years for now
    Trill Hosting - Cheap SSL, Cheap Web Hosting, Register Cheap Domains, Cheap Blog Hosting
    www.trillhosting.com | support@trillhosting.com
    Hosting Plans | Write To Us | Support | Client Area | About Us

    CodeCall Blog | CodeCall Wiki

  8. #8
    Newbie deny is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    Find-Ip-Address.org
    Posts
    13
    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 My Blog
    By Deathcry in forum Site Reviews
    Replies: 7
    Last Post: 01-14-2008, 08:57 PM
  2. Check if a file exists?
    By Lop in forum Pascal/Delphi
    Replies: 3
    Last Post: 01-07-2007, 12:54 AM
  3. How Do I check my HTML?
    By skilletsteve in forum HTML Programming
    Replies: 1
    Last Post: 09-13-2006, 11:12 AM
  4. Check if a file exists
    By Lop in forum C and C++
    Replies: 4
    Last Post: 08-07-2006, 10:03 PM
  5. Best way to check if an object is null?
    By dirkfirst in forum Managed C++
    Replies: 0
    Last Post: 08-01-2006, 07:29 AM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

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