Xyphon Posted December 17, 2007 Share Posted December 17, 2007 To IP ban people, how would I go about finding their IP? Thanks. Quote Link to comment Share on other sites More sharing options...
mfindlay Posted December 17, 2007 Share Posted December 17, 2007 $ip = $_SERVER['REMOTE_ADDR']; cheers... Quote Link to comment 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. Quote Link to comment 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! Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Xyphon Posted December 17, 2007 Author Share Posted December 17, 2007 Oh, thanks. Quote Link to comment 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); Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.