Junior Spellweaver
- Joined
- Feb 6, 2013
- Messages
- 196
- Reaction score
- 25
Hi, I am using an HTTP Reverse Proxy for my hotel.
I can't IP ban anyone because everyone has the same IP.
I assume I need to update ip_current, but to do so I need something that finds their real IP and that runs the query when they enter the client.
Like this:
And this maybe?
But where should I put them? And the codes is not finished, right?
I can't IP ban anyone because everyone has the same IP.
I assume I need to update ip_current, but to do so I need something that finds their real IP and that runs the query when they enter the client.
Like this:
Code:
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP'];} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];} else { $ip = $_SERVER['REMOTE_ADDR'];}
And this maybe?
Code:
UPDATE users SET ip_current = ? WHERE username = ?;
But where should I put them? And the codes is not finished, right?