Re: password field validation

From: Date: Thu, 12 Mar 2009 20:04:26 +0000
Subject: Re: password field validation
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-289953@lists.php.net to get a copy of this message
prueba con trim() : $pass=trim($_POST[PASSSWORD]); if (empty($pass)) { $GERROR="TRUE"; } Atte. Rodrigo (09) 7 7996571 On Thu, Mar 12, 2009 at 4:05 PM, Jason Todd Slack-Moehrle < mailinglists@mailnewsrss.com> wrote: > Hi All, > > I have an input field with type="password". > > I am trying to do some error checking to see if the user puts a value in > after they submit the form (i.e not left it blank) > > Here is what I have: > > on form: > Password: <input id="PASSWORD" name="PASSWORD" type="password" > size="15"> > > In PHP error checking: > > if (empty($_POST[PASSSWORD])) > { $GERROR="TRUE";} > > even though I am putting characters in the field before I submit I am > always getting TRUE returned. > > This same tactic works for other fields I have that I need to make sure > they put values in, just I have never done this before with a password > field. > > What am I doing wrong? I just want to make sure they put something there! > > -Jason > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#289953) next »