title: How do i redirect a php login file back to index.html presented with a message 'Welcome User'
body: <p>My work codes but the message is not showing up after clicking login. It does redirect for 5 second but does not show the appropriate message 'Welcome User'</p>
  
  <pre><code>$error = "";
  $success = "";
  
  //  username: user password: pass
  if (isset($_POST["submit"])) {
    $username = $_POST['username'];
    $password = $_POST['pass'];
    if ($username == "user") {
      if ($password == "pass") {
        $error = "";
        $success = "Welcome user!";
        header('Location: index.php');
        sleep(5);
      }
      else {
        $error = "Wrong Password!";
        $success = "";
      }
    }
    else {
        $error = "Wrong Username!";
        $success = "";
    }
  }
  </code></pre>