homepage Welcome to WebmasterWorld Guest from 54.167.179.48
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

    
i want to block my site in india
eldinboy

5+ Year Member



 
Msg#: 3153417 posted 10:14 am on Nov 11, 2006 (gmt 0)

dear deligates

i have some good friends in india who try to abuse my site

I am fed up

help how can i block my site in india

thank you

 

phparion

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 3153417 posted 1:28 pm on Nov 11, 2006 (gmt 0)

I think you can do it from your hosting panel easily to define a wild card IP series for India to block users from there BUT if you need an elegant php solution then write a code on your site pages that can read IP address of the visitor then match it with the wild card IP series of India (use regex) and if it is from India then redirect them to a friendly page where you can state your reasons for blocking them to use your sites.

by the way you should keep in mind that blocking Indian users can block some of your customers may be if you are selling anything on yoru site , it can hurt so think twice before doing it actually.

vipink

5+ Year Member



 
Msg#: 3153417 posted 4:10 am on Nov 15, 2006 (gmt 0)

Hi,

You may use IP to Country Database from [ip-to-country.webhosting.info...] to convert the IP of any user to its country location and accordingly redirect them to any page saying restricted access.

All you need to is export this database into a mysql database and read it using a simple query with php/mysql to resolve the location

phparion

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 3153417 posted 6:11 am on Nov 15, 2006 (gmt 0)

vipink: why to take the hassle of importing the complete database locally and then query it .. just use cURL to give a call to any site script that converts IP to location and then redirect visitor accordingly however this will make your site (index or anyother page with this code) slow depending on the speed of results from the third party site

Rhomboid

5+ Year Member



 
Msg#: 3153417 posted 7:30 am on Nov 15, 2006 (gmt 0)

If they are determined to mess with your site then this will have no effect. For one thing, these IP-to-country mappings aren't always accurate, but more importantly it's easy enough to use a proxy somewhere in another country (or Tor) to bypass these kinds of blocks. If I were you I'd focus my efforts on blocking the specific behavior (e.g. implement capchas if they are flooding posts) rather than the country.

nakulgoyal

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3153417 posted 7:52 am on Nov 15, 2006 (gmt 0)

can u throw in some details on what these "i have some good friends in india who try to abuse my site " are doing. I am curious to know. Are they from a particular region? Somebody you know or what? Are they copying your website? Stealing Data? Reusing it? Maybe there are other options to stop them apart from banning their IP range.

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