Menu icon Foundation
[abide]How do I draw out password stored in mysql?

hi,
I am currently working on a password which is stored inside mysql. How do I validate it and throw an error if the password validated is wrong when compared?

I keep getting an error when I removed the "error" class to test if I am able to use without any validation.

            

         <form action="signin.php" method="post" data-abide>
    			  <div class="name-field">
				    <label>Username <small>required</small></label>
				    <input type="text" required pattern="^[a-zA-Z0-9]{6,}$" name="user" placeholder="Username here..." />
				    <small class="error">Name is required and must be alphanumeric with at least 6 characters.</small>
				  </div>
				  <div class="password-field">
				    <label>Password <small>required</small></label>
				    <input type="password" name="password" placeholder="Password here..." />
				    <!-- <small class="error">The password must be at least 7 characters long.</small> -->
				  </div>
				  <input type="submit" class="button" value="Sign In" />
				</form>

Screen shot 2014 02 07 at 2.28.34 pm

abidevalidation

hi,
I am currently working on a password which is stored inside mysql. How do I validate it and throw an error if the password validated is wrong when compared?

I keep getting an error when I removed the "error" class to test if I am able to use without any validation.

            

         <form action="signin.php" method="post" data-abide>
    			  <div class="name-field">
				    <label>Username <small>required</small></label>
				    <input type="text" required pattern="^[a-zA-Z0-9]{6,}$" name="user" placeholder="Username here..." />
				    <small class="error">Name is required and must be alphanumeric with at least 6 characters.</small>
				  </div>
				  <div class="password-field">
				    <label>Password <small>required</small></label>
				    <input type="password" name="password" placeholder="Password here..." />
				    <!-- <small class="error">The password must be at least 7 characters long.</small> -->
				  </div>
				  <input type="submit" class="button" value="Sign In" />
				</form>

Screen shot 2014 02 07 at 2.28.34 pm
Donovan Ng over 5 years ago

I don't think you understood the issue I am facing currently. Let me re-explain with a picture.

Scenario: The password is stored inside mysql. I would like to have the password-field checking with mysql database. Is it possible with data-abide feature?

As the picture shows, it keeps throwing an error even when I typed in the correct password. Does this mean 'data-abide' does not respond with database at all? I am not clear on this part.

Could anyone guide me? thanks.

K Lim over 5 years ago

Hmm...

Are you declaring your form as data-abide="ajax"?

What I would do:
a) declare your form with data-abide="ajax".
b) handle the submit event yourself with javascript.
c) in your javascript handling code, make an ajax call to your mysql db to authenticate the password entered.

hope that helps.