PHP ver gevorderde |
|
Iedere keer als ik in mijn poll script heb gestemd, krijg ik:
Citaat: Warning: Cannot modify header information - headers already sent by (output started at /usr/local/psa/home/vhosts/..../httpdocs/Test/Poll/poll.php:74) in /usr/local/psa/home/vhosts/..../httpdocs/Test/Poll/poll.php on line 75
Mijn script is:
<?php
require("config.inc.php");
require("functies.fnc.php");
$sql = "SELECT * FROM `".$poll_tabel."` WHERE `einde`>=".$time_stamp." ORDER BY `begin` DESC LIMIT 1";
$result = mysql_query($sql);
$aantal = mysql_num_rows($result);
if(!isset($_POST['gardp']))
{
if($aantal < 1)
{echo "<center><p class=\"normaal\"><center>".$poll_txt[11]."</p></center>";}
elseif($aantal > 0)
{
$array = mysql_fetch_array($result);
$id = $array['id'];
if($_GET['actie'] == "")
{
if(!isset($_POST['doe_poll']))
{
if(check_gestemd($id, stem_ip()))
{
results($id);
$N_cOkIe = "new_vot_poll_".$id;
$J_cOkIe = "vot_poll_".$id;
if(isset($_COOKIE[$N_cOkIe]))
{
echo "<br /><p class=\"normaal\"><center>".$poll_txt[15]."</p></center>";
setcookie($N_cOkIe, false);
setcookie($J_cOkIe, true);
}
else
{echo "<br /><p class=\"normaal\"><center>".$poll_txt[12]."</p></center>";}
}
elseif(!check_gestemd($id, stem_ip()))
{
$vraag = $array['vraag'];
$antwoorden = $array['antwoorden'];
poll_venter($pi['poll_W'], $id, $vraag, $antwoorden, 'ja');
if($pi['st_resl'] == "true")
{echo "<center><p class=\"normaal\"><a href='?actie=result'>".$poll_txt[16]."</p></a></center>";}
}
}
elseif(isset($_POST['doe_poll']))
{
if(check_gestemd($id, stem_ip()))
{echo "<p class=\"normaal\">".$poll_txt[14]."</p>";}
elseif(!check_gestemd($id, stem_ip()))
{
$poll_id = $_POST['poll_id'];
$stem = $_POST['stem'];
$ip = stem_ip();
$insert = "INSERT INTO `".$stem_tabel."` (`id`, `ip`, `poll_id`, `antwoord`) VALUES ('', '".$ip."', '".$poll_id."', '".$stem."')";
mysql_query($insert);
$cookieN = "new_vot_poll_".$poll_id;
$cookie1 = "poll_".$poll_id;
$cookie2 = $poll_id."_llop";
setcookie($cookieN, true);
setcookie($cookie1, true);
setcookie($cookie2, true);
echo "<p class=\"normaal\">".$poll_txt[15]."</p>";
header("Location: ".$_SERVER['REQUEST_URI']);
}
}
}
if($_GET['actie'] == 'result')
{results($id);}
}
}
if($pi['show_vpz'] == "true")
{show_don_polls();}
?>
<style type="text/css" media="all">@import "Stijl.css";</style>
<?php require("config.inc.php"); require("functies.fnc.php"); $sql = "SELECT * FROM `".$poll_tabel."` WHERE `einde`>=".$time_stamp." ORDER BY `begin` DESC LIMIT 1"; if(!isset($_POST['gardp'])) { if($aantal < 1) {echo "<center><p class=\"normaal\"><center>".$poll_txt[11]."</p></center>";} elseif($aantal > 0) { $id = $array['id']; if($_GET['actie'] == "") { if(!isset($_POST['doe_poll'])) { if(check_gestemd($id, stem_ip())) { results($id); $N_cOkIe = "new_vot_poll_".$id; $J_cOkIe = "vot_poll_".$id; if(isset($_COOKIE[$N_cOkIe])) { echo "<br /><p class=\"normaal\"><center>".$poll_txt[15]."</p></center>"; } else {echo "<br /><p class=\"normaal\"><center>".$poll_txt[12]."</p></center>";} } elseif(!check_gestemd($id, stem_ip())) { $vraag = $array['vraag']; $antwoorden = $array['antwoorden']; poll_venter($pi['poll_W'], $id, $vraag, $antwoorden, 'ja'); if($pi['st_resl'] == "true") {echo "<center><p class=\"normaal\"><a href='?actie=result'>".$poll_txt[16]."</p></a></center>";} } } elseif(isset($_POST['doe_poll'])) { if(check_gestemd($id, stem_ip())) {echo "<p class=\"normaal\">".$poll_txt[14]."</p>";} elseif(!check_gestemd($id, stem_ip())) { $poll_id = $_POST['poll_id']; $stem = $_POST['stem']; $ip = stem_ip(); $insert = "INSERT INTO `".$stem_tabel."` (`id`, `ip`, `poll_id`, `antwoord`) VALUES ('', '".$ip."', '".$poll_id."', '".$stem."')"; $cookieN = "new_vot_poll_".$poll_id; $cookie1 = "poll_".$poll_id; $cookie2 = $poll_id."_llop"; echo "<p class=\"normaal\">".$poll_txt[15]."</p>"; header("Location: ".$_SERVER['REQUEST_URI']); } } } if($_GET['actie'] == 'result') {results($id);} } } if($pi['show_vpz'] == "true") {show_don_polls();} ?> <style type="text/css" media="all">@import "Stijl.css";</style>
(komt van deze site)
En als ik de resultaten wil bekijken:
Citaat: Warning: Cannot modify header information - headers already sent by (output started at /usr/local/psa/home/vhosts/fadetolife.be/httpdocs/Test/Poll/functies.fnc.php:309) in /usr/local/psa/home/vhosts/fadetolife.be/httpdocs/Test/Poll/poll.php on line 33
Warning: Cannot modify header information - headers already sent by (output started at /usr/local/psa/home/vhosts/.../httpdocs/Test/Poll/functies.fnc.php:309) in /usr/local/psa/home/vhosts/..../httpdocs/Test/Poll/poll.php on line 34
Kan iemand me helpen?:?: Pleas?
|