Jump to content
MakeWebGames

IP Banning tool [V1] + [V2]


Will

Recommended Posts

All pages on V1 have some script which checks to see if a file exists in the "ipban" folder which is the IP of the users browsing. If so it then blocks them.

This tool goes into the admin panel which allows you to add and remove IP bans.

In admin.php:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

You need to change the USER NAME part to your hosting username. If you use cpanel it will be that username.

Add the cases:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

And the links

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

If you don't have to code to check the ip here it is:

For the login + register pages etc:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Put is somewhere near the top.

In header.php put it in an appropriate place. Mine is under the crimeexp checking part:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

It is likely you already have the IP checking code there, so check first.

It is tested and works, any problems reply to this topic.

You need to make the ipbans folder CHMOD: 777

Link to comment
Share on other sites

Re: IP Banning tool [v1]

 

Wish this would have come out sooner lol. Gets tiring having to add the ip's manually. Wow no one has asked for this for V2 yet...

I think it will work without changes; there are no database functions or full pages.

Link to comment
Share on other sites

Re: IP Banning tool [V1] + [V2] (I think)

Here it is converted for V2..Not tested and rushed so sorry.

In staff.php, scroll to the bottom and find '}' after it add::

Code:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

You need to change the USER NAME part to your hosting username. If you use cpanel it will be that username.

In staff.php find:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Add the following cases :

Code:

case 'ipban': ipban(); break;

case 'ipbancon': ipbancon(); break;

case 'ipbanview': ipbanview(); break;

case 'ipbanremove': ipbanremove(); break;

 

And the links into smenu.php

Code:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

If you don't have the code to check the ip here it is:

For the login + register pages etc:

Code:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

BUT

 

You should have something like this already in your header.php so check first!

Finally, change the permission for the folder: ipbans to 777 so it is completely writeable.

I also advise you put a blank index.php / .html / .asp etc. in there so no-one can see what files are in there. Good Luck.

Link to comment
Share on other sites

Re: IP Banning tool [V1] + [V2]

hey, im trying to get this mod to work on my site, v2, im very new to all the coding business but ive managed to get it added to staff panel, i can go on to view banned ip's but when i go on to ban ip and click ban it says this

Warning: fopen(/home/tribalcl/public_html/ipbans/74.86.167.50) [function.fopen]: failed to open stream: Not a directory in /home/tribalcl/public_html/staff.php on line 228

Error Creating File

can anyone help please?

Link to comment
Share on other sites

Re: IP Banning tool [V1] + [V2]

I'm a little confused at why you would have to use a full link to the ipbans folder in the first place?

"You need to change the USER NAME part to your hosting username. If you use cpanel it will be that username."

Its possible i am mistaken but wouldnt you be able to just use /ipbans since it is in the public_html folder and not have to mess with using the username?

Link to comment
Share on other sites

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