Xyphon Posted December 17, 2007 Share Posted December 17, 2007 To IP ban people, how would I go about finding their IP? Thanks. Link to comment https://forums.phpfreaks.com/topic/82016-finding-ip-adresses/ Share on other sites More sharing options...
mfindlay Posted December 17, 2007 Share Posted December 17, 2007 $ip = $_SERVER['REMOTE_ADDR']; cheers... Link to comment https://forums.phpfreaks.com/topic/82016-finding-ip-adresses/#findComment-416721 Share on other sites More sharing options...
VirusDoctor Posted December 17, 2007 Share Posted December 17, 2007 Ofcourse the above is pretty useless if the user is using proxies, all he would have to do is change the proxy and they will no longer be banned. Link to comment https://forums.phpfreaks.com/topic/82016-finding-ip-adresses/#findComment-416723 Share on other sites More sharing options...
Xyphon Posted December 17, 2007 Author Share Posted December 17, 2007 No, no! I dont want to know how to do IP ban, I already know that. I want a way to track my users IPs, so I CAN ban them! Link to comment https://forums.phpfreaks.com/topic/82016-finding-ip-adresses/#findComment-416724 Share on other sites More sharing options...
VirusDoctor Posted December 17, 2007 Share Posted December 17, 2007 lol ok... Here's how I do it, in my login page, I have it update a users ip each time they login. Create a new column in your users table called user_ip then just do something like this in your login page $User_IP = $_SERVER['REMOTE_ADDR']; $IP = mysql_query (UPDATE users SET user_ip='$User_IP' WHERE username = '$username'") Hope that helps Link to comment https://forums.phpfreaks.com/topic/82016-finding-ip-adresses/#findComment-416727 Share on other sites More sharing options...
Xyphon Posted December 17, 2007 Author Share Posted December 17, 2007 If I do that I'll lose all of my members. Thats not good. I tihnk I should create a brand new table called IP, so I dont have to reset all fo my mems. Link to comment https://forums.phpfreaks.com/topic/82016-finding-ip-adresses/#findComment-416729 Share on other sites More sharing options...
adam291086 Posted December 17, 2007 Share Posted December 17, 2007 why would you lose all of your member? you are only update one column in your table. Link to comment https://forums.phpfreaks.com/topic/82016-finding-ip-adresses/#findComment-416731 Share on other sites More sharing options...
trq Posted December 17, 2007 Share Posted December 17, 2007 If I do that I'll lose all of my members. How? Link to comment https://forums.phpfreaks.com/topic/82016-finding-ip-adresses/#findComment-416732 Share on other sites More sharing options...
VirusDoctor Posted December 17, 2007 Share Posted December 17, 2007 lol Adam, thats what I was just about to ask. Link to comment https://forums.phpfreaks.com/topic/82016-finding-ip-adresses/#findComment-416733 Share on other sites More sharing options...
Xyphon Posted December 17, 2007 Author Share Posted December 17, 2007 O.O I mean. You have to drop a table to recreate it, how can I add a table? Link to comment https://forums.phpfreaks.com/topic/82016-finding-ip-adresses/#findComment-416735 Share on other sites More sharing options...
trq Posted December 17, 2007 Share Posted December 17, 2007 You dont have to drop any tables. Use ALTER TABLE. Link to comment https://forums.phpfreaks.com/topic/82016-finding-ip-adresses/#findComment-416736 Share on other sites More sharing options...
Xyphon Posted December 17, 2007 Author Share Posted December 17, 2007 Oh, thanks. Link to comment https://forums.phpfreaks.com/topic/82016-finding-ip-adresses/#findComment-416737 Share on other sites More sharing options...
Xyphon Posted December 17, 2007 Author Share Posted December 17, 2007 So like ALTER TABLE users ADD user_ip VARCHAR(225); Link to comment https://forums.phpfreaks.com/topic/82016-finding-ip-adresses/#findComment-416740 Share on other sites More sharing options...
VirusDoctor Posted December 17, 2007 Share Posted December 17, 2007 The simple way to do it would be to go into phpmyadmin and add the column to the table manually. Then just use the code I provided above. You dont even need to use ALTER then. Link to comment https://forums.phpfreaks.com/topic/82016-finding-ip-adresses/#findComment-416742 Share on other sites More sharing options...
trq Posted December 17, 2007 Share Posted December 17, 2007 Yeah, exactly like that except you'll want to use INT UNSIGNED. See here for a simple tutorial on storing ip addresses. Link to comment https://forums.phpfreaks.com/topic/82016-finding-ip-adresses/#findComment-416743 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.