CrzYMikE Member Joined Mar 19, 2011 Posts 11 Reacts 0 Reputation 0 Credits 0 Aug 31, 2010 #1 PHP: <?php $ips=array("127.0.0.1", "IP", "IP", "IP"); foreach ($ips as $ip) { if($_SERVER['REMOTE_IP']==$ip) { exit("You got banned!") } } ?> I'm sure someone will find use of this.
PHP: <?php $ips=array("127.0.0.1", "IP", "IP", "IP"); foreach ($ips as $ip) { if($_SERVER['REMOTE_IP']==$ip) { exit("You got banned!") } } ?> I'm sure someone will find use of this.
Life_mybb_import11509 Onyx user! Joined Mar 19, 2011 Posts 1,991 Reacts 0 Reputation 0 Credits 0 Aug 31, 2010 #2 RE: Simple IP Ban Didn't somebody already post this? I may be wrong.
CrzYMikE Member Joined Mar 19, 2011 Posts 11 Reacts 0 Reputation 0 Credits 0 Aug 31, 2010 #3 RE: Simple IP Ban God said: Didn't somebody already post this? I may be wrong. Click to expand... I don't think so... Came up with this a while back, felt like posting it... o.0
RE: Simple IP Ban God said: Didn't somebody already post this? I may be wrong. Click to expand... I don't think so... Came up with this a while back, felt like posting it... o.0
Proof_mybb_import11519 Member Joined Mar 19, 2011 Posts 36 Reacts 0 Reputation 0 Credits 0 Aug 31, 2010 #4 RE: Simple IP Ban Just do something like... PHP: <?php $ip[] = "127.0.0.1"; $ip[] = ""; foreach($ip as $ips){ if(in_array($_SERVER['REMOTE_ADDR'], $ips)) die("banned"); } ?>
RE: Simple IP Ban Just do something like... PHP: <?php $ip[] = "127.0.0.1"; $ip[] = ""; foreach($ip as $ips){ if(in_array($_SERVER['REMOTE_ADDR'], $ips)) die("banned"); } ?>
flAmingw0rm Member Joined Mar 19, 2011 Posts 148 Reacts 0 Reputation 0 Credits 0 Sep 1, 2010 #5 RE: Simple IP Ban Maybe this could be useful to prevent your site being DDoSed. Thanks!
GAMEKINGZ_mybb_import1105 Member Joined Mar 19, 2011 Posts 91 Reacts 0 Reputation 0 Credits 0 Sep 1, 2010 #6 RE: Simple IP Ban Yeah for sure i can use this for my forum or website . Thanks for sharing this.
xhtmlphp Member Joined Mar 19, 2011 Posts 42 Reacts 0 Reputation 0 Credits 0 Sep 2, 2010 #7 Pretty cool except 'in_array' would be more appropriate for this use.
Proof_mybb_import11519 Member Joined Mar 19, 2011 Posts 36 Reacts 0 Reputation 0 Credits 0 Sep 3, 2010 #8 xhtmlphp said: Pretty cool except 'in_array' would be more appropriate for this use. Click to expand... I was hoping someone would pick that up....
xhtmlphp said: Pretty cool except 'in_array' would be more appropriate for this use. Click to expand... I was hoping someone would pick that up....
RAF Onyx user! Joined Mar 19, 2011 Posts 5,010 Reacts 0 Reputation 0 Credits 0 Nov 18, 2010 #9 Trashed: PHP: Simple IP Ban[/b] This thread has been trashed, it will be moderated by the Administrators for a further opinion.
Trashed: PHP: Simple IP Ban[/b] This thread has been trashed, it will be moderated by the Administrators for a further opinion.
RAF Onyx user! Joined Mar 19, 2011 Posts 5,010 Reacts 0 Reputation 0 Credits 0 Dec 14, 2010 #10 Trashed: PHP: Simple IP Ban[/b] This thread has been verified to be a quality thread and has been moved back into the rightful forum section. Please contact Management if this was wrongfully done.
Trashed: PHP: Simple IP Ban[/b] This thread has been verified to be a quality thread and has been moved back into the rightful forum section. Please contact Management if this was wrongfully done.