This is my code:
ob_start();
echo"<script type='text/javascript'>alert('Wrong username or password Please try again')</script>";
header("Location:http://localhost/xampp/my_hospital/login.php");
ob_end_flush();
This code is located in a separate file called login_check.php.I want the alert to pop up and then it should redirect to login.php.The problem is the alert doesn't show up but the redirect works.