limit form input digits

From: Date: Wed, 07 May 2003 12:17:06 +0000
Subject: limit form input digits
Groups: php.general 
Request: Send a blank email to php-general+get-146655@lists.php.net to get a copy of this message
Hello All, I'm trying to limit to 99 the amount of times this prints ; if (ereg ("([^0-9]{2})", $incre)) { echo "bad input"; } else { echo "Printing now ...<br>"; } Reading the manual and the comments I thought the {2} would do that, but it doesn't. I have set the form field size to two but that isn't working either, you can still put more than two numbers in the field even though they don't show. The {2} does keep letters out but how can I limit the input to two digits ?

« previous php.general (#146655) next »