Postingan lainnya
Pasang swetalert di captcha malah bisa login meski captcha salah
halo selamat pagi apa yg salah yah ketika saya pasang swet alert pesan error pada captcha malah captcha di isi salah dan hasil nya tetap login.. kalo ane pake alert biasa itu berjalan tidak bisa masuk.
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- / MEMANGGIL FILE CSS -->
<link rel="stylesheet" href="alert/sweetalert.css">
<!-- / ------------------------------------------------ -->
</head>
<body>
<!-- / Proses login -->
<?php
session_start();
include 'config.php';
$AU_ID=($_POST['AU_ID']);
$AU_Pwd=($_POST['AU_Pwd']);
$AU_Pwd=md5($AU_Pwd)."0";
if(isset($_POST["captcha"])&& $_POST["captcha"]!=""&& $_SESSION["code"]==$_POST["captcha"]){
}else{
echo"<script type='text/javascript'>
setTimeout(function () {
swal({
title: 'Wrong username or password !!!',
text: 'Please Try again ',
type: 'warning',
timer: 2000,
showConfirmButton: false
});
},10);
window.setTimeout(function(){
window.location.replace('index.php');
} ,2000);
</script>";
}
if(!ctype_alnum($AU_ID) or !ctype_alnum($AU_Pwd)){
echo"Login Gagal";
}else{
$sql=mssql_query("select * from [appl_user] where AU_ID='".$AU_ID."' and AU_Pwd ='".$AU_Pwd."' ");
$data=mssql_fetch_array($sql);
$cek=mssql_num_rows($sql);
if($cek>0){
$_SESSION['uid']=$data['AU_ID'] ;
$_SESSION['grp']=$data['AU_GID'];
$_SESSION['namaLog']=$data['AU_Name'];
echo"<script type='text/javascript'>
setTimeout(function () {
swal({
title: ' Welcome $AU_ID ',
type: 'success',
timer: 2000,
showConfirmButton: false
});
},10);
window.setTimeout(function(){
window.location.replace('home/index.php');
} ,2000);
</script>";
}else{
echo"<script type='text/javascript'>
setTimeout(function () {
swal({
title: 'Wrong username or password !!!',
text: 'Please Try again ',
type: 'warning',
timer: 2000,
showConfirmButton: false
});
},10);
window.setTimeout(function(){
window.location.replace('index.php');
} ,2000);
</script>";
}
}
?>
<script src="alert/sweetalert.js"></script>
<script src="alert/sweetalert.min.js"></script>
</body>
</html>
0
Belum ada Jawaban. Jadi yang pertama Jawaban
Login untuk ikut Jawaban