I've never used PHP before, and I seem to have a poll script mostly working now, with the exception being the fact that it's giving me an error related to the cookie that stores if you've voted or not (so that you can see the results page after you vote).
When it shows you the results, directly above you see this error message:
Warning: Oops, php3_SetCookie called after header has been sent in /home/estrov2/poll/poll_cookie.php on line 18
The poll_cookie.php page looks like this:
====================================================
<?php ///////////////////////////////////////////////////
// Advanced Poll 1.6 (PHP) //
// Copyright (c)2001 Chi Kien Uong //
// URL: http://www.proxy2.de //
///////////////////////////////////////////////////
// this code is optional
// Important! You have to include it before your html code
$cookie_expire = 1; // hours
if (!isset($action)) {
$action='';
}
if ($action=="vote" && isset($vote_for)) {
$cookie_name = "AdvancedPoll".$poll_id;
if(!isset($$cookie_name)) {
setcookie($cookie_name, "1", time()+(3600*$cookie_expire));
}
}
?>
=====================================================
The HTML of the page calling poll_cookie.php:
=====================================================
<HEAD> <TITLE>test</TITLE>
</HEAD>
<BODY><BR>
<?PHP // this code snippet is optional
require ("/home/estrov2/poll/poll_cookie.php");
?>
<?PHP $poll_id = 5;
require ("/home/estrov2/poll/booth.php");
?>
</BODY>
=====================================================
I've read on a couple others sites that having spaces before <? or after ?> could lead to this error message, but I've checked the file and there aren't any.
I am totally stumped with this. Any help appreciated!