Re: Question About Blocking Email Addresses in Forms

From: Date: Fri, 18 Jan 2008 16:58:08 +0000
Subject: Re: Question About Blocking Email Addresses in Forms
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-267568@lists.php.net to get a copy of this message
Hello, on 01/18/2008 01:55 PM Javier Huerta said the following: > Thanks for all of your suggestions which all point to using Catpcha. I have > actually already implemented Capchta and they are still getting around it. > Even if they are entering it manually rather than via a bot, is there a way > to check if the email address is of a specific format and if so then don't > process the form? Sure. If you just want to block addresses of some domains, you do not even need to use regular expressions. Try something like this: $block = 'jhgfghjk.com'; $email = $_POST['email']; if(substr($email, -strlen($block)) === $block) { do whatever you want to not accept this address; } If you iterate this code over a list of blocked domains taken from an array, you have implemented a generalized black list. -- Regards, Manuel Lemos PHP professionals looking for PHP jobs http://www.phpclasses.org/professionals/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/

« previous php.general (#267568) next »