Support Forums

Old 01-21-2008, 08:09 PM   #1
Member
 
Join Date: Sep 2007
Posts: 58
Rep Power: 9
Jessej is on a distinguished road
Default block ip

how do i block an ip from viewing my site
Jessej is offline   Reply With Quote
Old 01-21-2008, 08:19 PM   #2
Coder
 
Join Date: Mar 2006
Posts: 4,567
Rep Power: 111
Lhotch is just really niceLhotch is just really nice
Default

Best bet is to do this at the host level. Most hosts have the ability to set IP's to block within the hosting interface.
__________________
Larry.
Lhotch is offline   Reply With Quote
Old 01-21-2008, 11:24 PM   #3
Member
 
Join Date: Sep 2007
Posts: 58
Rep Power: 9
Jessej is on a distinguished road
Default php

I am with 1and1 I hope this works here is the code for PHP


<?php
$deny = array("222.222.222", "333.333.333");
if (in_array ($_SERVER['REMOTE_ADDR'], $deny)) {
header("location: http://www.google.com/");
exit();
} ?>

any more feedback please
Jessej is offline   Reply With Quote
Old 01-22-2008, 08:37 AM   #4
Coder
 
Join Date: Mar 2006
Posts: 4,567
Rep Power: 111
Lhotch is just really niceLhotch is just really nice
Default

I dont know anything about 1and1 but as I said its much easier to log into your hosting control panel and implement their IP blocking tools than try and create your own.

And if your host doesnt offer such a function I suggest lookinginto doing it via .htaccess.

http://www.javascriptkit.com/howto/htaccess5.shtml
__________________
Larry.
Lhotch is offline   Reply With Quote

Bookmarks

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding content to specific pages archavir v3.1 Questions & Support 6 08-21-2007 05:08 AM


All times are GMT -4. The time now is 08:13 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0