<form method="post">
<input name="login" type="text">
<input name="submit" type="submit" class='btn' id="submit"></form>
<?php
if(empty ($_POST['login'])) {?>
<script>
window.onload = function() {
swal("Password or Login incorrect!");
}
</script>
<?php
} else {echo 'login correct';}
?>