Forgot your password?



 

Why sign up?
- One account for five websites!
- Free access to Premium Codes
- Acess to cool web tools
- Ask and answer questions
- Stay ahead of other web developers
- and MUCH MORE!

 





Feel The Power

webPhp Code: Ban IP


This code make you able to ban a person that you know their IP. so basically you can record the ip of the user and prohibit them to come to your website and visit your content.

Either create a new .php document in a text editor or add the following php to an existing .php document. (ex. index.php)
--
Now to explain the code.

1. 2. $ip = getenv('REMOTE_ADDR'); - Gets the users IP address
3. $blocked = "xx.xx.xx.xx"; - Tells the browser that the "xx.xx.xx.xx" IP is blocked/banned
4. if (ereg($blocked,$ip)) - If the blocked/banned IP is the same as the users IP, the following echo will be displayed.
5. { - Starts a bracket
6. echo "You Have Been Banned"; - Echos the "You Have Been Banned" line onto the page.
7. exit(); - Exit so no more content is ouput
8. } - Ends a bracket
9. ?> - Ends the php tag

If you don't know how to use this code or need more information Click here!

Go to Homepage


counter

tashima10 Posted on 24 January, 2011 - 08:56 AM 1
sdasdasd
 

You can leave comments once you sign in/up.


Review

Please Rate this!

Visitor

Onlines:
Total Online:
Recent Members: scienceguyz, mihir5555, sibekatea, evildead, OLFU_Cate_Imba