www.webdeveloper.com
Results 1 to 6 of 6

Thread: IP address Script Wanted

  1. #1
    Join Date
    Oct 2005
    Location
    Northern Ireland
    Posts
    38

    IP address Script Wanted

    can any one help me... i need an IP address script that works in IE

    the ip scripts i have seen either;
    1 - dont work in IE
    2 - hosted script on another site
    3 - not the type im lookin for

    wat im lookin for is a script that can tell the visitor his/her ip address in a <p></p> tag... not an image... not a table or form... not in the title... not in the status bar and not in an alert box... just a normal text type script

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Not with JavaScript; you need a server-side script.
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Jan 2005
    Location
    Los Angeles, CA
    Posts
    4,887
    rename your file's extension to SHTML and use the following SSI(Server Side Include) tag:
    Code:
    <!--#echo var="REMOTE_ADDR" -->
    If you don't want to rename your HTM or HTML file to SHTML, use the above in combination with HTACCESS:
    Code:
    AddType text/html .shtml .html .htm
    AddHandler server-parsed .shtml .html .htm
    The above you put in a file called ".htaccess" exactly that name! Do not put anything infront of the period/dot for this is a special file name that requires a leading period/dot. Put the HTACCESS file within the same directory as your HTM file.

    Another method is to use PHP. rename your HTM, HTML file to the PHP extension and use the following tag:
    Code:
    <?php echo $_SERVER['REMOTE_ADDR']; ?>
    Just insert those tags within your P taqs as if they were actual HTML tags.
    Last edited by Ultimater; 11-28-2005 at 12:23 PM. Reason: changed all "remain" to "rename", no code changed

  4. #4
    Join Date
    Oct 2005
    Location
    Northern Ireland
    Posts
    38
    ummm.. confused lol... so let me get this.. change .htm to shtml and insert

    <!--#echo var="REMOTE_ADDR" --> in the <p></p> tags so it wud look lik

    <p><!--#echo var="REMOTE_ADDR" --></p>

  5. #5
    Join Date
    Jan 2005
    Location
    Los Angeles, CA
    Posts
    4,887

  6. #6
    Join Date
    Oct 2005
    Location
    Northern Ireland
    Posts
    38
    ok thanks mate

Thread Information

Users Browsing this Thread

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

Posting Permissions

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



Recent Articles