...

View Full Version : Checking and saving IP in database



Krentenbol
11-26-2011, 03:03 PM
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.

Krentenbol
11-27-2011, 12:00 PM
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?

Dom Mv
11-28-2011, 01:03 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum