I have a user registration form and I’m trying to process and redirect the page to the “logged-in-user”(if info matches info in db and create sessions) it using jquery and php, but it isn’t working/I don’t understand how to do something/ Or is this possible. If the Username Field and or the Password Field are empty I want to show an error and not process it.
Heres my code.
js/jfunc.js
[code]$(document).ready(function() {
$(’#errors’).hide();
$(’#loginform’).submit(function() {
//when form is submitted
var user = $(’#user’).val();
var pass = $(’#pass’).val();
if ((user) == ‘’ || (pass) == ‘’){
$(’#errors’).html(“The username and the assword are required fields !”).fadeIn(500);
return false; // notice this !, this very important !
}else
$.post(‘includes/usercheck.php’,
{php_user: user, php_pass: pass}
,function(data){
});
});
});
[/code]
usercheck.php
[php]
Parsed in 0.162 seconds, using GeSHi 1.0.8.4
[/php]
