Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27
  1. #11

    Default

    Use the PHP one because some people have javascript disabled.

  2. #12
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default

    You can use either javascript/php.

    Personally, I would go for PHP. Simply renaming the page to .php and adding a little code (I'd do it like this):

    PHP Code:
    <?php
    $ip 
    $_SERVER['REMOTE_ADDR'];  
    echo 
    "<i>Your IP address has been logged: " $ip ".</i>";
    ?>
    That would appear something like this:

    Your IP address has been logged: 11.22.33.44

    And could simply be put at the bottom of the form.

    You can also simply add this to the area of the form coding that stores the data submitted in the form as variables (if PHP):

    PHP Code:
    $ip $_SERVER['REMOTE_ADDR']; 
    And this would register the visitor's ip as a variable ($ip), and if it's something like submitting an email, you just add it to the email like all the other variables ie. name etc.

    Hope I've helped.
    Last edited by iUnknown; 28-01-2009 at 11:05 PM.
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


  3. #13
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Quote Originally Posted by Hitman View Post
    If I can remember correctly, you can't do it. HTML is client side and doesn't have anything to do with the server (it's just a page on the server). You can use PHP though.

    Arent we trying to get the "clients" IP?

    Javascript is also client side (though you can still get the IP with it), though I think it might be because
    HTML is a markup language...??????????????????????????
    Hi, names James. I am a web developer.

  4. #14
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    why not just

    PHP Code:
    <?php echo $_SERVER'REMOTE_ADDR' ]; ?>
    instead of adding all your wacky YOUR IP IS" . $IP OH GOD SET A VARIABLE FOR SOMETHING THAT NEVER CHANGES

  5. #15
    Join Date
    Oct 2007
    Location
    Luton, England
    Posts
    1,548
    Tokens
    388
    Habbo
    DeejayMachoo

    Latest Awards:

    Default

    Quote Originally Posted by Jewish Bear View Post
    why not just

    PHP Code:
    <?php echo $_SERVER'REMOTE_ADDR' ]; ?>
    instead of adding all your wacky YOUR IP IS" . $IP OH GOD SET A VARIABLE FOR SOMETHING THAT NEVER CHANGES
    So true made me lol +rep


  6. #16
    Join Date
    Jan 2008
    Posts
    3,711
    Tokens
    100

    Latest Awards:

    Default

    Quote Originally Posted by Excellent2 View Post
    PHP Code:
    <?php

    $ip 
    $_SERVER['REMOTE_ADDR'];

    echo (
    'Your IP is: <br />$ip');

    ?>
    +REP IF I CAN

    Quote Originally Posted by --ss-- View Post
    Possible via Javascript:
    Code:
    var ip = '<!--#echo var="REMOTE_ADDR"-->';
    either use document.write or use a popup to display it .
    +REP IF I CAN

    Quote Originally Posted by iUnknown View Post
    You can use either javascript/php.

    Personally, I would go for PHP. Simply renaming the page to .php and adding a little code (I'd do it like this):

    PHP Code:
    <?php
    $ip 
    $_SERVER['REMOTE_ADDR'];  
    echo 
    "<i>Your IP address has been logged: " $ip ".</i>";
    ?>
    That would appear something like this:

    Your IP address has been logged: 11.22.33.44

    And could simply be put at the bottom of the form.

    You can also simply add this to the area of the form coding that stores the data submitted in the form as variables (if PHP):

    PHP Code:
    $ip $_SERVER['REMOTE_ADDR']; 
    And this would register the visitor's ip as a variable ($ip), and if it's something like submitting an email, you just add it to the email like all the other variables ie. name etc.

    Hope I've helped.
    THANKS, +REP IF I CAN

    Quote Originally Posted by Jewish Bear View Post
    why not just

    PHP Code:
    <?php echo $_SERVER'REMOTE_ADDR' ]; ?>
    instead of adding all your wacky YOUR IP IS" . $IP OH GOD SET A VARIABLE FOR SOMETHING THAT NEVER CHANGES
    Thanks, +REP IF I CAN

  7. #17
    Join Date
    Nov 2005
    Posts
    4,486
    Tokens
    921

    Latest Awards:

    Default

    Rofl, Jewish Bear makes me laugh every time. I'm loving the use of wacky. Anyway, glad to see it's been sorted. I'd say PHP is best.
    "RETIRED" FROM HABBO(X)

    :¬:

    TOMSPIT / COWLY05


  8. #18
    Join Date
    Jun 2008
    Location
    Manchester
    Posts
    766
    Tokens
    0

    Default

    Quote Originally Posted by --ss-- View Post
    Possible via Javascript:
    Code:
    var ip = '<!--#echo var="REMOTE_ADDR"-->';
    either use document.write or use a popup to display it .
    That's a server side include that for some reason has been combined with javascript. You could just do:
    HTML Code:
    Your IP is: <!--#echo var="REMOTE_ADDR"-->
    Both examples require certain configurations to work, otherwise every XSS vulnerability would be alot more serious.

  9. #19
    Join Date
    Jan 2008
    Posts
    3,711
    Tokens
    100

    Latest Awards:

    Default

    I tried "<!--#echo var="REMOTE_ADDR" -->"

    It does not work..

  10. #20
    Join Date
    Mar 2007
    Posts
    106
    Tokens
    0

    Default

    Fighting over single and double quotes...

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

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