I'm currently working on a new ham radio website which I can't say anything about yet (hence the infrequency of blog postings at the moment.) This site will require people to register in order to access the interactive pages, and I wanted to not only keep the spammers out, but also ensure that amateurs register using their callsigns.
Thanks to phant0m and nrg_alpha over at PHP Freaks Forums, I now have a nice little PHP function that checks whether the supplied argument looks like a valid callsign.
<?php(Note that I did not require the function to accept prefixes like F/G4ILO or G4ILO/P.)
// function to check if argument is in format of a valid callsign
function valid_call($callsign){
return preg_match('=^\d?[a-z]{1,2}\d{1,4}[a-z]{1,3}$=i', $callsign);
}
?>
You still have to figure out how to call it from your forum software, guest book script or whatever, but hopefully some will find it useful.
2 comments:
Julian,
I have two different Ham Radio Forums running(one is new)and I am forced to delete many registered users posting SPAM, PORN and various objectionable material. I am running vBulletin just like QRZ.com, so I would bet someone has added your PHP script to it. Just wondered if you would know how I might find hese instructions. I need this protection bad to keep out the rif raf, Thanks
Jerry - NF9L NF9L@arrl.net
http://K0GQ.com/forums
http://KCHamRadio.com
I don't know anything about vBulletin, Jerry, but I would guess that it has a support forum so I think the best place to ask would be there. You could also try asking Fred, AA7BQ, who runs QRZ.com. If he has done it, he might not mind telling you.
Post a Comment