I have a login form which redirects to a php script that then checks into the database if the user is registered and all that good stuff, what i want to do it’s that i want firefox or chrome remember the username and password ass it happens on all other pages.
Here is my code:
<form id="loginForm" action="../php/login.php" method="post">
<table>
<tr>
<td><label for="user">Username :</label></td>
<td><input name="user" id="user" type="text" /></td>
</tr>
<tr>
<td><label for="password">Password :</label></td>
<td><input name="password" id="password" type="password" /></td>
</tr>
<tr>
<td></td>
<td id="subCont"><input id="submit" type="submit" value="Login"></td>
</tr>
</table>
</form>
And i’m going to be handling all the information with jQuery Ajax method
var form = $('#loginForm');
form.on('submit',function(e){
e.preventDefault();
$this = $(this);
$.ajax({
type : 'post',
url : 'php/login.php',
data : $this.serialize(),
dataType : 'json',
success : function(r){
},
error : function(r){
window.alert(r.Message);
}
});
});
Remembering usernames and passwords is an option in the user’s browser, and not something that you can control.