Answer the question
In order to leave comments, you need to log in
Ban phone numbers in the web application
There is a bulletin board, and some comrades have already honestly got it. Decided to ban.
I created a new table in the database, I decided to store regexps there and then check it.
public function addUserAd ( ) {
...
$bannedPhonesPatterns = $this -> getBannedPhones ( ) ;
foreach ( $bannedPhonesPatterns as $patt ) {
if ( preg_match ( $patt , $body . $contacts ) ) {
$this -> reportError ( 12 ) ;
$this -> terminate ( ) ;
}
}
...
}
Now there are 4 numbers in the database, but the list will be replenished, I'm worried about performance. How else can such a system be organized?
Answer the question
In order to leave comments, you need to log in
IMHO, the usual ways to ban by phone are useless. I'm just very familiar with the work of the boards "from the inside" and with the methods of work of these very "some comrades".
Here's what these comrades will do when they see the message "Ad is not posted, because. your phone number has been banned from our website!” ? Yes, they stupidly take another number and post their ad. And so on until next time.
On one of my projects, I solved the problem in a different way. The task is this: to identify the “bad person” as reliably as possible.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question