Re: Invalid Charactors in a string.
| From: | Justin French | Date: | Wed, 27 Nov 2002 07:58:13 +0000 |
| Subject: | Re: Invalid Charactors in a string. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-126243@lists.php.net to get a copy of this message | ||
Hi,
if(!preg_match("/^[a-z0-9_]*$/", $username))
{
// the string contained a char other than a-z, 0-9 and _ (underscore)
}
Season to taste :)
Justin
on 27/11/02 6:18 PM, Philip J. Newman (newmanpj@philipnz.com) wrote:
> Where should i start, tips wanted.
>
> I would like to check a username string for valid charactors before the name
> is processed.
>
> Someone point me in the right direction please
>
> ---
> Philip J. Newman.
> Head Developer.
> PhilipNZ.com New Zealand Ltd.
> http://www.philipnz.com/
> info@philipnz.com
>
> Mob: +64 (25) 6144012.
> Tele: +64 (9) 5769491.
>
> VitalKiwi Site:
> Philip J. Newman
> Internet Developer
> http://www.newman.net.nz/
> info@newman.net.nz
>
> *****************************
> Friends are like Stars,
> You can't always see them,
> But you know they are there.
>
> *****************************
>
> ICQ#: 20482482
> MSN ID: philipsdomain@hotmail.com
> Yahoo: philip_newman@yahoo.com
> AIM: newmanpjkiwi
>
>
Justin French
--------------------
http://Indent.com.au
Web Development &
Graphic Design
--------------------