943,626 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 651
  • PHP RSS
Dec 1st, 2008
0

Change PAssword

Expand Post »
Hello friends,

I'm in a serious problem....... I have a change password application for registered users......I've applied javascript to check wheather fields are blanks or not but incase if someone press spacebar in new password and retype new password fields then it accept it . Now I want to block if someone try to press spacebar in new password cases.........please help to solve this error.......
Similar Threads
Reputation Points: 8
Solved Threads: 2
Junior Poster in Training
nil_gh_80 is offline Offline
64 posts
since Aug 2007
Dec 1st, 2008
0

Re: Change PAssword

html Syntax (Toggle Plain Text)
  1. <form method='post'>
  2. Username: <input type='text' value='' name='user'><br>
  3. Password: <input type='text' value='' name='password'><br>
  4. </form>
Well there are 2 main easy ways that you can do the activation process. Assuming above is the form you allready have, then if you just want to check there is only a space used or no password at all then the below lines of code will work:
php Syntax (Toggle Plain Text)
  1. <?
  2. if ($_POST['password']!==' ' && strlen($_POST['password'])>0 && isset($_POST['password']))
  3. {
  4. //activate account
  5. }
  6. ?>

Or you could just set a minimum password length of something like 8 letters/numbers/characters which is done like the following:
php Syntax (Toggle Plain Text)
  1. <?
  2. $minimum_length=8;
  3. if (strlen($_POST['password'])>=$minimum_length && isset($_POST['password']))
  4. {
  5. //activate account
  6. }
  7. ?>
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,004 posts
since Sep 2007
Dec 1st, 2008
0

Re: Change PAssword

Someone plzzzzzzzzz reply.................
Reputation Points: 8
Solved Threads: 2
Junior Poster in Training
nil_gh_80 is offline Offline
64 posts
since Aug 2007
Dec 1st, 2008
0

Re: Change PAssword

Thanks man it works........
Reputation Points: 8
Solved Threads: 2
Junior Poster in Training
nil_gh_80 is offline Offline
64 posts
since Aug 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Checkbox array
Next Thread in PHP Forum Timeline: quick question need quick answer





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC