I have following PHP if/else statement – how can I tell it to go back to login.php and run jQuery function?
if($result) {
if(mysql_num_rows($result) == 1) {
//Login Successful
session_regenerate_id();
$member = mysql_fetch_assoc($result);
$_SESSION['SESS_MEMBER_ID'] = $member['member_id'];
$_SESSION['SESS_FIRST_NAME'] = $member['firstname'];
$_SESSION['SESS_LAST_NAME'] = $member['lastname'];
$_SESSION['SESS_LOGIN'] = $member['login'];
session_write_close();
header("location: ../index.php");
exit();
}else {
$error = true;
// go back to login.php and run jQuery function
}
}else {
die("Query failed");
// // or go back to login.php and run different jQuery function
}
you could use:
or
and on your
login.phpinside yourjavascript tags:you can use
phpfor:so Continuing from your
elsestatement: it should be:continuing from your else statement: