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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -