In this code:

$Sql = "select * from Member where UserName='$UserName' and Password='$Password'";
$Result = mysql_query($Sql);
while ($Row = mysql_fetch_array($Result))
{
setcookie ("VBZooM","$UserName",time()+604800);
}

--
It give me this error

Warning: Cannot add header information - headers already sent by (output started at C:\apache\htdocs\vbzoom\admin\config.php:27) in C:\apache\htdocs\vbzoom\login.php on line 54

--
How can I solve this error ? and what it's hte cause of this error ?