jbroder - 8:38 pm on Mar 23, 2011 (gmt 0)
Your regex looks right to me. You might want to test it separately to get at what is really going on here. Instead of working in this big block of code, you could just make a separate test file that says this:
if(preg_match("/^[0-9]+/", "-") echo 'it matches the dash!';
and once you figure out why it matches the dash, you can then do this:
if(preg_match("/^[0-9]+/", $_POST['name'])) 'it matched the dash via POST!';
and once you have that straight, you are ready to fix the script.
Debugging is easiest when you isolate a problem and then throw different solutions at it until it works.