Forum Moderators: coopster
This time around I thought I could modify it, to validate usernames on characters (letters, numbers, - and _ only).
So i cooked up this script:
if (eregi('^[a-zA-Z0-9\_\-]$', $name)) {
echo 'Valid';
} else {
echo 'Invalid';
}
$pattern = "/^[a-zA-Z0-9_-]+$/";
if (eregi($pattern, $name)) {
Tried both 'techniques', but it still comes up as Invalid.
The odd part is it ALWAYS comes up as Invalid, no matter what you enter as $name.
Entering: 'ASdF324' as $name give Invalid (though it should be valid)
Entering: '^@&#@#*(@#{}::><' as $name also give invalid (which should be correct( but shows the ELse isnt reversed or anything.)