Re: Detecing a Number

From: Date: Wed, 04 Dec 2002 21:07:51 +0000
Subject: Re: Detecing a Number
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-127037@lists.php.net to get a copy of this message
If you are getting a number from a user via a form you can use javascript to verify that the user inputed a number... search google -> validating forms that should give you some info. You could also verify that the data is a number by is_numeric or is_int... I think that when the data is POSTed that it will be a string so you can use is_numberic to verify if it is... http://www.php.net/manual/en/function.is-numeric.php On Wed, 2002-12-04 at 14:01, Stephen wrote: > I have a repeating function to add. The user enters the number of how many > numbers they want to add, then it repeats a form field. What I want to do is > detect to make sure that the value they enter is a number. If not, don't do > the do while loop and if it is, then go ahead and do it. How can I do this? > > Thanks, > Stephen Craton > http://www.melchior.us > > "What is a dreamer that cannot persevere?" -- > http://www.melchior.us > > > ______________________________________________________________________ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#127037) next »