Jump to content


Photo

help using wildcards to perform multipole tasks


  • Please log in to reply
2 replies to this topic

#1 darkcarnival

darkcarnival
  • Members
  • PipPipPip
  • Advanced Member
  • 162 posts

Posted 06 March 2006 - 12:14 AM

hi,

I wish to better improve my banning system on my member script by being able to ban a wildcard of items.

like for example i would like to ban anyone who enters a hotmail account or some other free free mail account.

i also would like to do this for IP's too.

though I dont know how to do a wildcard check like this.

any help on this would be welcomed.

thanks :)

#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 06 March 2006 - 01:16 AM

use a regualr expression.

so if the users submits a hotmail account in the registration form...

if (preg_match('/hotmail/',$_POST['mail'])) {
...do stuff to stop registration...
}

you can also have...

$stop = '/hotmail|';
$stop .= 'yahoo|';
$stop .= 'gmail/';

if (preg_match($stop,$_POST['mail'])) {
...do stuff to stop registration...
}


follow me on twitter @PHPsycho

#3 darkcarnival

darkcarnival
  • Members
  • PipPipPip
  • Advanced Member
  • 162 posts

Posted 06 March 2006 - 02:19 AM

would that method also work for ips?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users