दिसम्बर 17 2018 02:19:39
Language Switcher
नेविगेशन
· Start/घर
· Downloads/डाउनलोड
· Faq/एफ.ए.क्यू
· Forum/चर्चा मंच
· Weblinks/वेब लिंक्स
· Rules/नियम
· Privacy/गोपनीयता नीतियाँ
· Contact/संपर्क करें
· Search/खोज करें
· Advance Fusion Search
बॉक्स चिल्लाऊँ
You must login to post a message.

26-04-2018 22:26
Hello

24-07-2017 21:53
Hello all members.
View Thread
Who is here? 1 guest(s)
All MODs and their Supported Threads goes here in this Section.
 Print Thread

[MOD]Prevent certain countries to register

Wanabo
If you have a website aimed at only 1 country and receive a lot of spammers from other countries then you can prevent them registering with this mod.

Or just block unwanted countries.

In this example I use XX for the country codes so I cannot offend any countries by listing them here.
Replace XX for the desired country to block.

Open register.php and find around line 86
Download source  Code

   if (!preg_match("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $email)) {
      $error .= $locale['406']."<br />\n";
   }





Insert directly below this code.
Download source  Code

// block unwanted countries. See Wipmania.com for country list. Mod by Wanabo.
if (getenv(HTTP_X_FORWARDED_FOR)) {$trueip = getenv(HTTP_X_FORWARDED_FOR);} else {$trueip = getenv(REMOTE_ADDR);}
$blockcountry = array("XX","XX","XX");
$country = file_get_contents("http://api.wipmania.com/".$trueip."?".$_SERVER['HTTP_HOST']."");
if ($country == in_array($country,$blockcountry)) {$error .= $locale['406']."<br />\n";}
// end country mod





Improvements of this code is welcome.
Cool
 
Ankur
Thanks for this Good MOD Wanabo.... Wink

Also, you can Block them through the .htaccess if you want to Block particular IPs or IP Range from a particular Country !!! Smile
Be What you want to be...Wink
 
www.php-fusion.in
Wanabo
But in htaccess, you prevent them from viewing your site as well.
Besides ip ranges change now and then, wipmania.com keeps them updated for you. Smile
Cool
 
Ankur
Wanabo wrote:
But in htaccess, you prevent them from viewing your site as well.


Agree... Cool
Be What you want to be...Wink
 
www.php-fusion.in
Jump to Forum:
New Thread Post Reply
Gebruik BBcode of HTML om naar; '[MOD]Prevent certain countries to register', te verwijzen!
BBcode:
HTML:
उपयोगकर्ता ऑनलाइन
· अतिथि ऑनलाइन: 1

· सदस्य ऑनलाइन: 0

· कुल सदस्य: 77
· नवीन सदस्य: Jonathan Boytloong
लॉग इन
उपयोगकर्ता नाम

पासवर्ड



अभी तक सदस्य नहीं?
रजिस्टर करने के लिए यहाँ क्लिक करें.

पासवर्ड भूल गए?
नए पासवर्ड यहाँ अनुरोध करें.
अंतिम देखा उपयोगकर्ताओं
Your ad here below?
Website Version

Download latest
PHP Fusion Package
This Website is using PHP Fusion v7.02.07 as Current Version.

Portfolio
· BetterClimate.Net
· ComplaintSupport.Com
· Daily-Breaking-News.Com
· Kidiot.Org
· Php-Fusion.Asia
· Php-Fusion.Cn
· Php-Fusion.Fr
· Php-Fusion.Org
· Php-Fusion.Start-Pages.Com
· Rain-Radar.Com
· Speed-Testing.Net
· Start-Pages.Com
· WebhostingTrouble.Com
· WebmasterTrouble.Com
645,335 unique visits