Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Redirecting to a new page based on an AJAX call
- $.post("chklogin.php", { username: username, password: password }, function(data) {
- $('#msg').html(data);
- });
- if(mysql_num_rows($result)==0) {
- $msg="<h3>Enter valid Username and Password.</h3>";
- echo $msg;
- } else {
- $row=mysql_fetch_assoc($result);
- $_SESSION["userid"]=$row["pgmail"];
- header("location:user.php");
- }
- echo 'SUCCESS';
- $.post("chklogin.php", { username: username, password: password }, function(data) {
- if(data=='SUCCESS'){
- window.location.href = "user.php";
- }else{
- $('#msg').html(data);
- }
- });
Add Comment
Please, Sign In to add comment