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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2011
    Posts
    116
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Checking and saving IP in database

    I want to make an "if-else statement"

    if (check if the users ip is in db)

    else (some action, save the users ip and it should be thrown out after an hour)

    I could someone explain this to me? How I should do this.

  • #2
    Regular Coder
    Join Date
    Sep 2011
    Posts
    116
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Update:

    I know I've to use $_SERVER['REMOTE_ADDR'], but when I echo this, I get ::1. I guess from 127.0.0.1. But would this work when I save the ip of my visitors that way?

  • #3
    New Coder
    Join Date
    Sep 2011
    Location
    England
    Posts
    39
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Krentenbol View Post
    Update:

    I know I've to use $_SERVER['REMOTE_ADDR'], but when I echo this, I get ::1. I guess from 127.0.0.1. But would this work when I save the ip of my visitors that way?
    If you managed to get ::1 in the database whilst using localhost, then yes, it will work.


  •  

    Posting Permissions

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