Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 25

Thread: IP

  1. #1
    Senior Member krazy's Avatar
    Join Date
    Apr 2003
    Location
    California
    Posts
    543
    Member #
    1078
    just so people dont abuse my form, how do i make it so that it will show their IP on their post?
    Ad space - for sale, $19.95/month

  2.  

  3. #2
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    Using SSI (filename must end in .shtml):
    Regular Server-side HTML:
    [minicode]<!--#echo var="REMOTE_ADDR"-->[/minicode]

    or for use with JavaScript:
    Code:
    <script type="text/javascript">
     var ip = '<!--#echo var="REMOTE_ADDR"-->';
     document.write(ip);
    </script>
    - Brian

  4. #3
    Senior Member krazy's Avatar
    Join Date
    Apr 2003
    Location
    California
    Posts
    543
    Member #
    1078
    yes, but how do i make it that it will show their IP with their post, will that do it?
    Ad space - for sale, $19.95/month

  5. #4
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Depends... are you using PHP ?

  6. #5
    Senior Member krazy's Avatar
    Join Date
    Apr 2003
    Location
    California
    Posts
    543
    Member #
    1078
    here's what im using.

    http://www.webdesignforums.net/showt...5&pagenumber=1

    skrlin's code

    something similar. made some modifications
    Ad space - for sale, $19.95/month

  7. #6
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    PHP Code:
    ...

    $IP getenv("REMOTE_ADDR");

    ... 
    To display it, use echo $IP like so:
    PHP Code:
    <?php
      $IP 
    getenv("REMOTE_ADDR"); 
      echo 
    "Your IP address is $IP";
    ?>
    or
    PHP Code:
    <?php
      $IP 
    getenv("REMOTE_ADDR"); 
      echo 
    "Your IP address is ";
      echo 
    $IP;
    ?>
    - Brian

  8. #7
    Senior Member splufdaddy's Avatar
    Join Date
    Feb 2003
    Location
    Boston, MA
    Posts
    4,488
    Member #
    735
    PHP commands will only work in a .php file. Instead of posting this question, you could have just tried renaming it to a .php file.

  9. #8
    Senior Member krazy's Avatar
    Join Date
    Apr 2003
    Location
    California
    Posts
    543
    Member #
    1078
    stupid website! lol.
    skrlin, when u got the time, go to my site and tell me whats wrong. i cant post. view source to see what im doing wrong.

    http://killerinstincts.servegame.com/app
    Ad space - for sale, $19.95/month

  10. #9
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    First off:
    [minicode]riesthod="post"[/minicode]
    I'm guessing this is a typo, and should be
    [minicode]method="post"[/minicode]

    and this
    [minicode]action="/enter.html/"[/minicode]
    should be
    [minicode]action="enter.html"[/minicode].
    One problem with that is, I don't see a enter.html in that directory. The other problem I see with that is when the data gets "posted" to the file enter.html, HTML itself has no way of handling this data. It needs to be handled on the server end so that the files on the server may be created/updated.

    Post your php source for your index.php and any other pages that are involved in this and we shall see what we can do to help then.
    - Brian

  11. #10
    Senior Member krazy's Avatar
    Join Date
    Apr 2003
    Location
    California
    Posts
    543
    Member #
    1078
    here is the other 1
    Ad space - for sale, $19.95/month


Page 1 of 3 1 2 3 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:19 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com