From owner-freebsd-questions@FreeBSD.ORG Thu Mar 2 01:17:06 2006 Return-Path: X-Original-To: freebsd-questions@FreeBSD.ORG Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 49EAC16A420 for ; Thu, 2 Mar 2006 01:17:06 +0000 (GMT) (envelope-from lists@interpool.ca) Received: from simmts6-srv.bellnexxia.net (simmts6.bellnexxia.net [206.47.199.164]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB60543D48 for ; Thu, 2 Mar 2006 01:17:05 +0000 (GMT) (envelope-from lists@interpool.ca) Received: from localhost ([70.48.91.66]) by simmts6-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with SMTP id <20060302011704.NCVM25660.simmts6-srv.bellnexxia.net@localhost>; Wed, 1 Mar 2006 20:17:04 -0500 Date: Wed, 1 Mar 2006 20:17:20 -0500 From: Gerry Freymann To: fbsd_user@a1poweruser.com Message-Id: <20060301201720.688d1d29.lists@interpool.ca> In-Reply-To: References: Organization: Interpool Development www.interpool.ca X-Mailer: Sylpheed version 1.0.6 (GTK+ 1.2.10; i386-portbld-freebsd5.4) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Help with PHP eregi alnum if statement X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2006 01:17:06 -0000 On Tue, 28 Feb 2006 14:16:06 -0500 "fbsd_user" wrote: >I am trying to test the login id entered from a form. >Checking that the contents are upper or lower case alpha or numeric >0-9 >plus the special characters - dash and # pound sign > >Code: > >if(eregi("([[:alnum:]\#\-]+)", $loginid)) > { print("loginid is alnum"); } else { print("loginid is not >alnum"); } > > > >I get the message "loginid is alnum" no matter what I enter to test. > >What is wrong with the statement syntax that it don=92t work >correctly? Perhaps you can modify this segment of code to allow characters and your dash a pound sign... at the moment it allows only letters. if (!eregi("^[_a-z0-9-]+[_a-z0-9-]+$",$form[username])) {=20 $error .=3D "Invalid characters in Username (only a-zA-Z_-allowed)|"; =09 }=20 -gerry