php - jscript header reload same page -
in php site, using script alert checking invalid username , password. if username , password wrong, shows message box. when click ok
it, user redirected index.php page. want reload same page, header('location: '.$_server['php_self']);
.
this code :
echo "<script>alert('invalid username , password'); location.href='index.php'; </script>";
you can use location.reload()
echo "<script>alert('invalid username , password'); location.reload();</script>";
the reload()
function has optional parameter:
- false - default. reloads current page cache.
- true - reloads current page server
Comments
Post a Comment