obey-robots.txt
View Thread
Keep spammers and bots out.
 Print Thread
Register.php prevent certain countries to register
Fusioneer
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.

Open register.php and find around line 86
Download source  GeSHi: PHP
  1.  
  2. if (!preg_match("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $email)) {
  3. $error .= $locale['406']."\n";
  4. }
  5.  
Parsed in 0.026 seconds, using GeSHi 1.0.8.10


Insert directly below this code.
Download source  GeSHi: PHP
  1.  
  2. // block unwanted countries. See Wipmania.com for country list. Mod by Wanabo.
  3. unset($country);
  4. if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $trueip = ($_SERVER['HTTP_X_FORWARDED_FOR']); } else { $trueip = ($_SERVER['REMOTE_ADDR']); }
  5. $blockcountry = array("CM","MX");
  6. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://api.wipmania.com/".$trueip."?".$_SERVER['HTTP_HOST']."");
  7. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 3);
  8. $country = curl_exec($ch);
  9. if (curl_errno($ch) > 0) { curl_close($ch); } else { if ($country == in_array($country,$blockcountry)) { curl_close($ch); redirect("contact.php"); }}
  10. // end block unwanted countries mod
  11.  
Parsed in 0.018 seconds, using GeSHi 1.0.8.10


Improvements of this code is welcome.
Warning about ParkingCrew.com! Case: ParkingCrew.com acquires NameDrive.com but earnings are not transferred despite assurances and promises. Inquiries about this are ignored! It's just a con compagny. Don't do business with them!
 
Jump to Forum
New Thread Post Reply
Use BBcode or HTML to refer to; 'Register.php prevent certain countries to register'
BBcode:
HTML:
Simular threads
Subject Discussion Forum         Last Post
Protect register.php against proxy registrations Modifications to protect your website : 1 13-03-2012