Re: Detecting if GET field is Numeric or Alpha numeric

From: Date: Wed, 19 Mar 2003 06:26:56 +0000
Subject: Re: Detecting if GET field is Numeric or Alpha numeric
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-140254@lists.php.net to get a copy of this message
Helo, use is_numeric($str) to check whether a string contains all numeric values. Foong "Stephen Of Blank Canvas" <stephen@blankcanvas.info> wrote in message news:000201c2eddf$c365bdf0$d1ae92cb@vaio... > Hi Everyone, > > Does anyone know if it is possible to check the values of a $_GET field > and see if the submitted data is numeric or contains any letters. > > What I want to do is allow users to link to a record in a MySQL db using > the record id's and the values of the name field. > > www.domain.com/showlisting.php?town=1 and > www.domain.com/showlisting.php?town=London > > Both would work by performing a search on different fields in the MySQL > SELECT statement. Just an idea to make thing easy for users, any help > appreciated. > > Thanks > > Stephen >

« previous php.general (#140254) next »