<button type='submit' action='#' class='btn btn-primary block full-width m-b' id='showsimple1'>Login</button>
$name = $_POST['name'];
$password = $_POST['password'];
if(!($usr = $db->getRow("SELECT `userid` FROM `".MLS_PREFIX."users` WHERE `username` = ?s AND `password` = ?s", $name, sha1($password))))
$(function() {
$('#showsimple1').click(function(){
// Display a error toast, with a title
toastr.options = {
"closeButton": true,
"debug": false,
"progressBar": true,
"preventDuplicates": true,
"positionClass": "toast-top-right",
"onclick": null,
"showDuration": "400",
"hideDuration": "1000",
"timeOut": "7000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
toastr.error('Username or password are wrong!')
});
})
else {
if($_POST['r'] == 1){
$path_info = parse_url($set->url);
setcookie("user", $name, time() + 3600 * 24 * 30, $path_info['path']); // set
setcookie("pass", sha1($password), time() + 3600 * 24 * 30, $path_info['path']); // set
}
$_SESSION['user'] = $usr->userid;
header("Location: $set->url/home.php");
exit;
}
第一個代碼是我的提交按鈕添加在登錄敬酒時密碼或用戶名是錯誤的
我不能管理,使這項工作,我一直在試圖彈出敬酒密碼或用戶名輸入時是不正確的。我的代碼中總是存在解析錯誤。
您不必包紮點擊監聽器裏你'toastr'剛刪除點擊監聽器 –
我該如何具體做到這一點?對不起,我的速度很慢 –
這裏有什麼混合的js和php? –