Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can you find an IP address with PHP?

    Now that I have finished my forum, I am working on a chat room sorta thing.

    I know PHP isn't meant for this, But I wanna try, A birthday pressie for my friend who likes chat rooms.


    How can you find an IP address with PHP, or is it even possible. I want to make a block users system.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    $_SERVER['REMOTE_ADDR']

    PHP isn't the ideal language to make a chatroom. You're gonna have to continually refresh the page.

  • #3
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Right...

    Yeah...

    I went through all the $_SERVER[] things on Dreamweaver MX, and That is the one that brought Up an IP address, but I thought I could have been my sites IP address 'cos it was done at the server.

    So thanks!

    As for the page refreshing, I know! Page refreshing seems like the only way.


    Thanks for your help.

    Matt

  • #4
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There are other ways of doing a real-time chat

    However, they are difficult...

    ::] krycek [::
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."

  • #5
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I know

    I have a flash chatroom, But I didn't make it and no-one ever uses it.

    I also got a room from centralchat.net, Which Is Java. What would really help if I could find examples of flash and PHP.

    If any of you have ever been to habbohotel.com and been on the chat there, you will know that you can mix Shockwave and, I think it's ASP, And I have seen Flash and PHP.

    Any more help appreciated.

    Matt

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    A thought....

    You might not want to have the entire page reload, that'll require a lot of bandwidth. You can always have an iframe with style="display: none;" that links to a text file with the messages and have the page read from that.

  • #7
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    We are getting off topic now. The original question of how to obtain the users IP address using PHP was answered so I will close this thread. If you wish to discuss creating chatrooms in PHP then open a new thread..
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

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