Dear all I wonder if anybody can help me how do you check that a number entered into a textfield is a number and not letters it seems that php will accept letters and regard them as zero and just carry on. How can I make it notice that a number was not entered?
Thanks very much!
use ereg() function regular expressions is complex and it hard to understand for newbie, but it's powerful tool. just try.
I've tried the 'ereg-func.' in checking a field 'username', and this if (ereg("[0-9]", $username)) is simple, but how do I check for special characters => (ereg("[0-9+-?]", $username)) sure don't work and escaping with \ doesn't work either???
I sort figured it out... checking: if (!ereg("[a-bA-Z]", $name)) .... seems to work as it only allows letters...!