Quick verification of real names.
Posted: Sat Jan 28, 2006 4:49 pm
For a small website I needed the users to enter their name (firstname, lastname) - BUT: I wanted to keep the number of nonsense names as low as possible.
Checking the input against static lists would be VERY cumbersome and prone to errors, so I came up with this idea:
Find an online phonebook of the country the user will mainly be from - and try to access it directly by using GET variables.
Example:
I'm checking the name in 2 steps, because otherwise the search might return nothing, because it does not know "John Smith" - BUT with this approach it will return results for "smith" and for "john" separatedly. Remember: I don't want to check THIS certain person - but I want to know if the parts of his name make any sense.
EXTRA - Whipped cream with cherry on top:
Since a lot of those online phonebooks support wildcard search (e.g: "Jo*"), you would get results for incomplete names, too. I thought about parsing the search result with a regexp, storing matching strings in an array (e.g. using php's global regexp search).
It might be necessary to eliminate duplicate entries manually.
The array contents can then be offered to the user as a "Please select your proper name:" list.
e.g.: Joe, John, Johnny, Josef, ...
The only drawback is that names NOT listed on the first search result page will not be listed.
Checking the input against static lists would be VERY cumbersome and prone to errors, so I came up with this idea:
Find an online phonebook of the country the user will mainly be from - and try to access it directly by using GET variables.
Example:
Code: Select all
// Check firstname:
http://www.myphonebook.com/search?name=&firstname=John
// Check lastname:
http://www.myphonebook.com/search?name=Smith&firstname=
EXTRA - Whipped cream with cherry on top:
Since a lot of those online phonebooks support wildcard search (e.g: "Jo*"), you would get results for incomplete names, too. I thought about parsing the search result with a regexp, storing matching strings in an array (e.g. using php's global regexp search).
It might be necessary to eliminate duplicate entries manually.
The array contents can then be offered to the user as a "Please select your proper name:" list.
e.g.: Joe, John, Johnny, Josef, ...
The only drawback is that names NOT listed on the first search result page will not be listed.