Jump to content
MakeWebGames

Recommended Posts

Posted

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

Posted

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

Posted

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.

Posted
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!!!

Posted
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.

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...