```
<?php
$user = mysql_real_escape_string($_POST['login']);
$password = mysql_real_escape_string(sha1($_POST['password']));
$query = mysql_query("SELECT * FROM  `users` WHERE name =  '$user' AND pass =  '$password' AND privileges = 'superuser'");
$num_rows = mysql_num_rows($query);

if($num_rows == '1') {
$expire = time()*60*60*60*60;
setcookie("user","$user",$expire);
$_SESSION['user'] = $user;
include '/views/admin/admin.php';
}
else {
echo "Username and Password are incorrect! (Maybe you don't have permission!)";
}
?>

```

It says 

> 
> Warning: Cannot modify header information - headers already sent by
>  (output started at Z:\home\test1.ru\www\views\admin\validate.php:1) in
>  Z:\home\test1.ru\www\views\admin\validate.php on line 9
> 
> 
> 

line 9 is - setcookie("user","$user",$expire);