-=[ šârgódhïâñš ]=--=[ GrOuP]=-
Would you like to react to this message? Create an account in a few clicks or log in to continue.

-=[ šârgódhïâñš ]=--=[ GrOuP]=-

All Booters Hacking And Cracking Sotware And Much More ______Comming So0on_____
 
HomeSearchLatest imagesRegisterLog in

 

 Basic IP Ban script

Go down 
AuthorMessage
__Red_EyEs__
Admin
__Red_EyEs__


Number of posts : 306
Age : 39
Registration date : 2007-07-10

Basic IP Ban script Empty
PostSubject: Basic IP Ban script   Basic IP Ban script Icon_minitimeWed Jul 11, 2007 4:08 am

Okay, heres something quick. All it really does is grab the user's IP and then check it against a list of banned users. If the IP matches a banned one, then it stops them from viewing the site and gives them a message. The code is quite basic, but I'll explain some anyway.


PHP Code:

<php>
Pretty simple stuff, but it does the job. Let's explain it a little.

- $ip = getenv('REMOTE_ADDR'); - I'm assigning the person's IP to the variable $ip. $ip is used when checking the IP against the banned list.
- $email = "your@mail.com" - Change
[email]your@mail.com[/email] to your e-mail. This gives people a chance to contact you in case of a mistake.
- $banzored1 = "000.000.000" - Change the 0's to the person's IP you wish to ban. That assigns the banned person's IP to the variable. It is the same with banzored1 to 3.
- if($ip == $banzored1 || $ip == $banzored2 || $ip == $banzored3) - Here we're checking the $ip variable (where we stored the persons IP) against a list of banned IPs. If it matches, it echos and will not let them view the site. If it does not match, the user will be allowed to view the site normally.

----

Simple but it works. You can have as many IP's in the $banzored lists as you want. Just remember to assign to the variable and check it in our if statement.

Maybe some more stuff from me coming soon. Will see how popular this is !! See ya
Back to top Go down
http://red-eyes.top-me.com
 
Basic IP Ban script
Back to top 
Page 1 of 1
 Similar topics
-
» Learning Visual Basic 6 ebook
» visual basic 6.0 full version

Permissions in this forum:You cannot reply to topics in this forum
-=[ šârgódhïâñš ]=--=[ GrOuP]=- :: »¦« Programming »¦« :: HTML-
Jump to: