Veasey Posted July 19, 2010 Posted July 19, 2010 This is a quick mod that ive made, i have not got a clue how to ban more then one IP but this is just something ive made quickly so members might add to there game, this is ban users by there ip address so they can not access your game by login / register / inside game! so you don't have to do it manually by codes, you can just do it by staff panel! Enjoy Add this to your PHPMYADMIN: [mysql]INSERT INTO settings VALUES('','game_ip_ban','XX.XXX.XXX.XXX'); [/mysql] Now Open Up Header.php & Login.php & Register.php And Add You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Save & Close; Now Open Up Staff.php And Find You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Add Underneath You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Save & Close, That Should Be It Like i said, its only something small, i dont know how to ban more than one IP ADDRESS so if anyone can tell me it will be great, thank you & enjoy Quote
Danny696 Posted July 19, 2010 Posted July 19, 2010 More than one ip: [mysql]INSERT INTO settings VALUES('','game_ip_ban','XX.XXX.XXX.XXX|xxx.xxx.xxx.xxx');[/mysql] Header edit: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Rest is the same Quote
Analog Posted July 20, 2010 Posted July 20, 2010 I just have to laugh... Danny, wasn't you just telling me implode/explode was "the worst way to do it" and now you use it ;) Another method to do this would be create a separate table to store just the banned IP addresses and check against it. Quote
Danny696 Posted July 20, 2010 Posted July 20, 2010 For what you used it with it was a bad way ;) Quote
Analog Posted July 20, 2010 Posted July 20, 2010 For what you used it with it was a bad way ;) LOL, and how is this different? Your taking multiple values storing in one db field, using explode to put them in an array, and checking against it... There is no difference!!! Quote
Veasey Posted July 20, 2010 Author Posted July 20, 2010 I must say, creating a new table for the bans is a better idea but though it was a quick mod i made, i might just work on it :D ;) Thanks Quote
Guest Posted July 20, 2010 Posted July 20, 2010 More than one ip: [mysql]INSERT INTO settings VALUES('','game_ip_ban','XX.XXX.XXX.XXX|xxx.xxx.xxx.xxx');[/mysql] Header edit: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Rest is the same What's the point in using a for loop when you can just use the in_array function, by the way i've edited your post on mine. Also would be easier if you stored IP addresses line by line, easier to scan threw the list then, making it easier for your self. Example You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
rulerofzu Posted July 21, 2010 Posted July 21, 2010 Basic? it does what its meant to do. What else should it do. :whistling: Quote
kcmajor36 Posted July 21, 2010 Posted July 21, 2010 Basic? it does what its meant to do. What else should it do. :whistling: ^ He has a point. But a good script! :thumbsup: Quote
DizzyBone&Amy Posted July 21, 2010 Posted July 21, 2010 I meant its just simple, nothing really special. It does do what it supposed to do though, :) Quote
DizzyBone&Amy Posted July 21, 2010 Posted July 21, 2010 simple is often better nice mod :) That is very true. Oh and Veasey, may i suggest something :)? I heard ereg is deprecated, doesn't matter yet anyway, but i suggest using in_array Quote
Naffer20 Posted August 31, 2010 Posted August 31, 2010 Am a noob, where do i add the ('','game_ip_ban','XX.XXX.XXX.XXX|xxx.xxx.xxx.xxx'); in settings? an how? Quote
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.