rembo
1
Hello ,
Am try to show this toast massage after user successfully Login :
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 3000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
Toast.fire({
icon: 'success',
title: 'Signed in successfully'
})
But i don’t know how to do that , any help with this please ?
Thanx…
arbei
2
Your code does not show when you show the toast. Where did you put your code? How did you determine if the login is successful?
rembo
3
I make this worked by Set session on user successful login then Unset this session, to show only one time, In Server Events → Page Foot add this :
<?php if (isset($_SESSION['success_login'])) {?>
<script>
function showtoasterlogin(){
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 3000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
Toast.fire({
icon: 'success',
title: 'Signed in successfully'
})
}
document.onload = showtoasterlogin();
</script>
<?php unset ($_SESSION['success_login']);?>
<?php } ?>
Is this right way to start session in phpmaker ?
am sorry but am not familiar about Set sessions in phpmaker
Thanx…
arbei
4
Your approach is fine, but the line:document.onload = showtoasterlogin();is not exactly correct. You may try:window.onload = showtoasterlogin;