session_start();
$_SESSION['name'] = $_POST['login'];
$_SESSION['surname'] = $_POST['password'];
$_SESSION['user'] = $_POST['user'];
<?php
require_once 'handler.php';
if(empty($_SESSION['login']) || empty($_SESSION['password']) || empty($_SESSION['user'])){
?>
<script type="text/javascript">
window.location = "http://localhost/";
</script>
<?php
} else {
echo 'Успех!';
}
?>