Re: Making a Password Confirmation in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2010-06-24 at 11:22 -0700, Michael Calkins wrote:

> This is very straight forward, if password a and b are not equal to each other, how can I let the user know that with out losing all of the entered information on the registration form?
> I was trying this: 
> ---$p1 = "<input type=\"password\" name=\"usr_p1\" />";
> $p2 = "<input type=\"password\" name=\"usr_p2\" />";
> // if they didn't match return
> $p1 = "<input type=\"password\" name=\"usr_p1\"  value=\"" . $p1 . "\"/>";---
> I was trying to change the value of the variable which shows the input field to have the password already in it.
> and either one would just be echo'd depending on the result.
> Any ideas please?
> 
> From,Michael Calkinsmichaelcalkins@xxxxxxxx
> 
> elementFontfont-familyfont-sizefont-stylefont-variantfont-weightletter-spacingline-heighttext-decorationtext-aligntext-indenttext-transformwhite-spaceword-spacingcolorBackgroundbg-attachmentbg-colorbg-imagebg-positionbg-repeatBoxwidthheightborder-topborder-rightborder-bottomborder-leftmarginpaddingmax-heightmin-heightmax-widthmin-widthoutline-coloroutline-styleoutline-widthPositioningpositiontopbottomrightleftfloatdisplayclearz-indexListlist-style-imagelist-style-typelist-style-positionTablevertical-alignborder-collapseborder-spacingcaption-sideempty-cellstable-layoutEffectstext-shadow-webkit-box-shadowborder-radiusOtheroverflowcursorvisibility 		 	   		  
> _________________________________________________________________
> Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
> http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1


When you output the form again, output it with the values that were sent
to you (take care about deliberate injection though)

For things like select lists, I find I end up creating these from an
array in PHP anyway, so it's easy to loop through the array and set the
selected attribute if that's the value that was picked. Checkboxes and
radio buttons; if the value has been sent by the user, then mark them
checked when you output the html for them.

Don't fill password boxes, as that confuses the user. If they mistyped,
how do they know what value it holds anyway?

Thanks,
Ash
http://www.ashleysheridan.co.uk



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux