I'm having the below problem when I vote on a poll on a site..

Warning: Cannot modify header information - headers already sent by (output started at /header.php:77) in /poll/poll_cookie.php on line 21

You can still vote on it, its just this error comes up and streches the table If anyone can help that would be greatful..

If you wanted to know, its an RPG game, and theres alot of code in header.php and I hate problems with the sessions iswell before..

Also heres line twenty one :

        setcookie($cookie_name, "1", $endtime);
And if you wanted, heres the poll code:

$cookie_expire = 96; // hours

$action = (isset($HTTP_GET_VARS['action'])) ? $HTTP_GET_VARS['action'] : '';
$action = (isset($HTTP_POST_VARS['action'])) ? $HTTP_POST_VARS['action'] : $action;
$poll_ident = (isset($HTTP_GET_VARS['poll_ident'])) ? $HTTP_GET_VARS['poll_ident'] : '';
$poll_ident = (isset($HTTP_POST_VARS['poll_ident'])) ? $HTTP_POST_VARS['poll_ident'] : $poll_ident;

if ($action=="vote" && (isset($HTTP_POST_VARS['option_id']) || isset($HTTP_GET_VARS['option_id']))) {
    $cookie_name = "AdvancedPoll".$poll_ident;
    if (!isset($HTTP_COOKIE_VARS[$cookie_name])) {
        $endtime = time()+3600*$cookie_expire;
        setcookie($cookie_name, "1", $endtime);