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 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: PHP IP?

  1. #1
    Join Date
    Apr 2008
    Location
    Nottingham
    Posts
    213
    Tokens
    0

    Default PHP IP?

    How do I get a users ip in php?

  2. #2
    Join Date
    Aug 2005
    Location
    London
    Posts
    9,773
    Tokens
    146

    Latest Awards:

    Default

    PHP Code:
    $ip $_SERVER['REMOTE_ADDR']; 
    Then use the $ip variable for what ever you want to do.

  3. #3
    Join Date
    Apr 2008
    Location
    Nottingham
    Posts
    213
    Tokens
    0

    Default

    i want to php include on my website though? how do i make it into a file?

  4. #4
    Join Date
    Aug 2005
    Location
    London
    Posts
    9,773
    Tokens
    146

    Latest Awards:

    Default

    Quote Originally Posted by Liburd View Post
    i want to php include on my website though? how do i make it into a file?
    Sorry but that doesn't make any seance?
    I'm guessing you want to display it?
    PHP Code:
    $ip $_SERVER['REMOTE_ADDR'];
    echo (
    "Your ip is $ip"); 

  5. #5
    Join Date
    Apr 2008
    Location
    Nottingham
    Posts
    213
    Tokens
    0

    Default

    Lol, say i have index.php and I want to include a file say ip.php what do I put in the ip.php file to make it show on my index.php page?

  6. #6
    Join Date
    Aug 2005
    Location
    London
    Posts
    9,773
    Tokens
    146

    Latest Awards:

    Default

    Quote Originally Posted by Liburd View Post
    Lol, say i have index.php and I want to include a file say ip.php what do I put in the ip.php file to make it show on my index.php page?
    To include the file called ip.php you would put this php code in your index.php file:
    PHP Code:
    <?php include("ip.php"); ?>

  7. #7
    Join Date
    Apr 2008
    Location
    Nottingham
    Posts
    213
    Tokens
    0

    Default

    Ive tryed that but dont work :S www.habboinfo.co.uk its jsut blank :S

  8. #8
    Join Date
    Aug 2005
    Location
    London
    Posts
    9,773
    Tokens
    146

    Latest Awards:

    Default

    Quote Originally Posted by Liburd View Post
    Ive tryed that but dont work :S www.habboinfo.co.uk its jsut blank :S
    Because you have no content in your ip.php file?

    By looking at your site i'm guessing you want to show their actual ip, this is done by echoing it out.
    PHP Code:
    <?php $ip $_SERVER['REMOTE_ADDR'];
    echo (
    "$ip"); ?>

  9. #9
    Join Date
    Apr 2008
    Location
    Nottingham
    Posts
    213
    Tokens
    0

    Default

    thank you! works now +rep

  10. #10
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Liburd View Post
    thank you! works now +rep
    ive seen the nav buttons on your site on another fansite.
    Lets set the stage on fire, and hollywood will be jealous.

Page 1 of 2 12 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
  •