Go Back   Web Hosting UK Forums | Linux Windows Dedicated Server and cPanel VPS Hosting Forum > Services > Web Designing and Development

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-01-2007, 05:47 AM
Banned
 
Join Date: Apr 2007
Location: Bharatpur-10,Chitwan
Posts: 25
Send a message via Yahoo to anish
Default Banning IP's

if you use cookie..... then people remove those cookie........ then they can access it again????

use php code instead:
PHP Code:
<?
$banned
[0]="xxx.xxx.xxx.xxx"// IP in the form of "127.0.0.1" or whatever
$banned[1]="yyy.yyy.yyy.yyy";
$banned[2]="zzz.zzz.zzz.zzz";

// add as many as you wish

if (in_array($_SERVER['REMOTE_ADDR'],$banned)) header("HTTP/1.1 403 Forbidden");
?>
anyway... use .htaccess method is the safer way:

PHP Code:
order allow,deny
deny from 127.0.0.1
deny from 127.0.0.2
deny from 127.0.0.3
allow from all 
All these.
----------------------------------------------------------------------
-Anish
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:36 AM.
Copyright 2002-2007 WebHosting.uk.com. All rights reserved.
Web Hosting UK Forum