About my name checking at Register.
I use preg_match because I can specify chars as well as min/max length.
In the script below I am rather strict.
The username must begin with one alpha char [a-z]
As I use the 'i' (case insensitive) flag at the end [A-Z] is also allowed, without I need to add it.
[a-z] ..... 1 alpha
[a-z0-9\s_] .... a number chars, alphanum and space, underscore
[a-z0-9] ...... last char is alphanum .. not space/underscore
$patt2 is to avoid double spaces or double underscores
$mn = minimum length
$mx = maximum length
$mn = 4; $mx = 20;
$patt1 = '#^[a-z][a-z0-9\s_]{'.($mn-2).','.($mx-2).'}[a-z0-9]$#i';
$patt2 = '#\s\s|__|\s_|_\s#';
Here is my full script. You can run it directly as a DEMO Test
<?php
$name = isset($_POST['name'])? $_POST['name']:'';
$mn = 4; $mx = 20;
$patt1 = '#^[a-z][a-z0-9\s_]{'.($mn-2).','.($mx-2).'}[a-z0-9]$#i';
$patt2 = '#\s\s|__|\s_|_\s#';
if(preg_match($patt1,$name) && !preg_match($patt2,$name))
$msg = 'okay';
else $msg = 'no';
?>
<form method="post" style="margin-top:300;text-align:center;">
<input type="text" name="name" value="<?php echo $name ?>"><br />
<input type="submit"><br /><?php echo $msg ?></form>
About numeric in $_GET.
You are right, [man]ctype_digit[/man] is very good for this.
Also of course [man]preg_match[/man] can be used.