homepage Welcome to WebmasterWorld Guest from 50.16.112.199
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Ban IP
with a php script
kwekkel

5+ Year Member



 
Msg#: 6886 posted 6:39 pm on Feb 11, 2005 (gmt 0)

heyz, is it possible for me to block a IP with a script? I searched and searched but don't find anything. can someone help me?

thanks #*$!x

 

alcheme

10+ Year Member



 
Msg#: 6886 posted 6:42 pm on Feb 11, 2005 (gmt 0)

I use Cpanel for my web hosting accounts and you can use the IP DENY feature.

Check to see if your web hosting account includes a Cpanel and look for IP DENY. It will block as may IP's or IP blocks you like. No coding needed.

HughMungus

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 6886 posted 6:44 pm on Feb 11, 2005 (gmt 0)

$ip = GetHostByName($REMOTE_ADDR);
if ($ip == "theirip") exit;

You can also store the banned IP's in a database and handle it that way.

dreamcatcher

WebmasterWorld Senior Member dreamcatcher us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 6886 posted 7:23 pm on Feb 11, 2005 (gmt 0)

If its only a handful of IP addresses that you want to ban, put them in an array and check against that. I use cpanels IP banning feature myself, its very useful.

dc

Timotheos

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 6886 posted 8:15 pm on Feb 11, 2005 (gmt 0)

You could use the principles in this Spider Trap [webmasterworld.com] as well.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved