php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2004

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 17.06.2004, 22:04  
Gast
 
Beiträge: n/a
Standard Warning: Cannot modify header information....

Warning: Cannot modify header information - headers already sent by (output started at /srv/www/htdocs/web14/html/index.php:5) in /srv/www/htdocs/web14/html/index.php on line 382

das ist der fehler das steht in line 382 (hervorgehoben rot!!)

Code:
<?php
/* Poll
   Version: 1.0
   Last Update: 13.01.2004
   
   Info: This Poll was created for the Farcry Community Website.
   
        ** by Gainwar **
*/

        include("poll/config/config.inc.php");

    echo "<table width=\"140\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" align=\"center\" bgcolor=\"4A81A3\">
                <tr>
                  <td align=\"center\">";
                  
        $countp = mysql_num_rows(mysql_query("SELECT poll_id FROM poll WHERE active=1"));

        if($countp != "0")
        {

                if(isset($HTTP_COOKIE_VARS["fcpoll"]))
                {
                $query = mysql_query("SELECT poll_id FROM poll WHERE active=1");
                $data  = mysql_fetch_array($query);

                if($data[poll_id] == $HTTP_COOKIE_VARS["fcpoll"])
                {
                $poll = "results";
                }
                
                }

        if($poll == "")
        {
        $query = mysql_query("SELECT * FROM poll WHERE active=1");
        $data  = mysql_fetch_array($query);
        
        echo "".$data[question]."";
        
        echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
              <form action=\"".$PHP_SELF."?poll=results&VOTE=TRUE&poll_id=".$data[poll_id]."\" method=\"post\">";
        
                if(!empty($data[ans_1]))
                {
                echo "<tr>
                          <td width=\"30\"><input type=\"radio\" name=\"vote\" value=\"1\"></td>
                          <td>".$data[ans_1]."</td>
                        </tr>";
                } else { echo ""; }
                
                if(!empty($data[ans_2]))
                {
                echo "<tr>
                          <td width=\"30\"><input type=\"radio\" name=\"vote\" value=\"2\"></td>
                          <td>".$data[ans_2]."</td>
                        </tr>";
                } else { echo ""; }
                
                if(!empty($data[ans_3]))
                {
                echo "<tr>
                          <td width=\"30\"><input type=\"radio\" name=\"vote\" value=\"3\"></td>
                          <td>".$data[ans_3]."</td>
                        </tr>";
                } else { echo ""; }
                
                if(!empty($data[ans_4]))
                {
                echo "<tr>
                          <td width=\"30\"><input type=\"radio\" name=\"vote\" value=\"4\"></td>
                          <td>".$data[ans_4]."</td>
                        </tr>";
                } else { echo ""; }
                
                if(!empty($data[ans_5]))
                {
                echo "<tr>
                          <td width=\"30\"><input type=\"radio\" name=\"vote\" value=\"5\"></td>
                          <td>".$data[ans_5]."</td>
                        </tr>";
                } else { echo ""; }
                
                
        echo "
        
        <tr>
                
                <td><input class='textmenu' type=\"submit\" value=\"Ok\"></td>
              </tr>
        </form></table>";
        
        }
        elseif($poll == "results")
        {
                if($VOTE == "TRUE" && $vote != "")
                {
                $query = mysql_query("SELECT * FROM poll WHERE active=1");
                $data  = mysql_fetch_array($query);
                
                        if($HTTP_COOKIE_VARS["fcpoll"] != $data[poll_id])
                        {
                        if($vote == "1") { mysql_query("UPDATE poll SET ansvote_1=".($data[ansvote_1]+1)." WHERE poll_id=".$poll_id); }
                        if($vote == "2") { mysql_query("UPDATE poll SET ansvote_2=".($data[ansvote_2]+1)." WHERE poll_id=".$poll_id); }
                        if($vote == "3") { mysql_query("UPDATE poll SET ansvote_3=".($data[ansvote_3]+1)." WHERE poll_id=".$poll_id); }
                        if($vote == "4") { mysql_query("UPDATE poll SET ansvote_4=".($data[ansvote_4]+1)." WHERE poll_id=".$poll_id); }
                        if($vote == "5") { mysql_query("UPDATE poll SET ansvote_5=".($data[ansvote_5]+1)." WHERE poll_id=".$poll_id); }
setcookie("fcpoll",$poll_id,time()+60*60*24*30);
Code:
                        }
                        else
                        {
                                include("poll/tpl/novoteallowed.htm");
                        }
                        
                }
                elseif($VOTE == "TRUE" && $vote == "")
                {
                        include("poll/tpl/novoteid.htm");
                }
        
                $query = mysql_query("SELECT * FROM poll WHERE active=1");
                $data  = mysql_fetch_array($query);
                $grundwert = $data[ansvote_1]+$data[ansvote_2]+$data[ansvote_3]+$data[ansvote_4]+$data[ansvote_5];
                $multiplikator = "1"; // 1 = 100px // 1.5 = 150px => 100%
                
                echo "".$data[question]."";
                
                echo "

<table class='textmenu' border=\"0\" cellspacing=\"2\" cellpadding=\"0\">";
                
                        if(!empty($data[ans_1]))
                        {
                        //Prozentsatz Ausrechnen
                        $perc = ceil(100 / $grundwert * $data[ansvote_1]);
                        
                        echo "<tr>
                                <td><img src=\"poll/images/poll2.gif\"> ".$data[ans_1]."</td>
                              </tr>
                              <tr>
                                <td><img src=\"poll/images/poll.gif\" border=\"0\" width=\"".($perc*$multiplikator)."\" height=\"7\"> (".$perc."%)</td>
                              </tr>";
                        } else { echo ""; }
                        
                        if(!empty($data[ans_2]))
                        {
                        //Prozentsatz Ausrechnen
                        $perc = ceil(100 / $grundwert * $data[ansvote_2]);

                        echo "<tr>
                                <td><img src=\"poll/images/poll2.gif\"> ".$data[ans_2]."</td>
                              </tr>
                              <tr>
                                <td><img src=\"poll/images/poll.gif\" border=\"0\" width=\"".($perc*$multiplikator)."\" height=\"7\"> (".$perc."%)</td>
                              </tr>";
                        } else { echo ""; }
                        
                        if(!empty($data[ans_3]))
                        {
                        //Prozentsatz Ausrechnen
                        $perc = ceil(100 / $grundwert * $data[ansvote_3]);

                        echo "<tr>
                                <td><img src=\"poll/images/poll2.gif\"> ".$data[ans_3]."</td>
                              </tr>
                              <tr>
                                <td><img src=\"poll/images/poll.gif\" border=\"0\" width=\"".($perc*$multiplikator)."\" height=\"7\"> (".$perc."%)</td>
                              </tr>";
                        } else { echo ""; }
                        
                        if(!empty($data[ans_4]))
                        {
                        //Prozentsatz Ausrechnen
                        $perc = ceil(100 / $grundwert * $data[ansvote_4]);

                        echo "<tr>
                                <td><img src=\"poll/images/poll2.gif\"> ".$data[ans_4]."</td>
                              </tr>
                              <tr>
                                <td><img src=\"poll/images/poll.gif\" border=\"0\" width=\"".($perc*$multiplikator)."\" height=\"7\"> (".$perc."%)</td>
                              </tr>";
                        } else { echo ""; }
                        
                        if(!empty($data[ans_5]))
                        {
                        //Prozentsatz Ausrechnen
                        $perc = ceil(100 / $grundwert * $data[ansvote_5]);

                        echo "<tr>
                                <td><img src=\"poll/images/poll2.gif\"> ".$data[ans_5]."</td>
                              </tr>
                              <tr>
                                <td><img src=\"poll/images/poll.gif\" border=\"0\" width=\"".($perc*$multiplikator)."\" height=\"7\"> (".$perc."%)</td>
                              </tr>";
                        } else { echo ""; }
                        
                        
               echo "<tr>
                       <td>
Teilnehmer: ".$grundwert."</td>
                     </tr>
               </table>";

        }
        else
        {
                include("poll/tpl/noselectpoll.htm");
        }
        
        
        
        
        }
        else
        {
                include("poll/tpl/nopolls.htm");
        }
        
                echo "</table>";


?>
 
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 17.06.2004, 22:10  
Gast
 
Beiträge: n/a
Standard Re: Warning: Cannot modify header information....

Zitat:
Zitat von Rambow
Warning: Cannot modify header information - headers already sent by (output started at /srv/www/htdocs/web14/html/index.php:5) in /srv/www/htdocs/web14/html/index.php on line 382

das ist der fehler das steht in line 382 (hervorgehoben rot!!)
Falsch, der Fehler beginnt in Zeile 5.

28.13. Warning: Cannot add header information - headers already sent ...
http://www.dclp-faq.de/q/q-fehler-header.html
 
Alt 17.06.2004, 22:17  
Gast
 
Beiträge: n/a
Standard

Was ist denn da falsch?
 
Alt 17.06.2004, 22:40  
Gast
 
Beiträge: n/a
Standard

wenn man die fehlermeldung lesen würde und dann noch php.net wüsste man dass vor header-funktionen kein html-output stehen darf
meikel hat dir doch ein geeigneten link geschickt
 
Alt 18.06.2004, 01:38  
Gast
 
Beiträge: n/a
Standard Danke meikel

Danke meikel!

Wieder hat eine Deiner Antworten geholfen!!!

Ich werde mal mehr mit php.net arbeiten!

php123
 
 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Cannot modify header information PHP-Fortgeschrittene 13 24.10.2006 20:01
Cannot modify header information...??? imported_FlasH PHP Tipps 2007 33 12.11.2005 11:58
Warning: Cannot modify header information - headers already LP PHP Tipps 2005-2 2 12.09.2005 19:28
Fehler: Warning: Cannot modify header information - headers PHP Tipps 2005-2 14 01.09.2005 15:02
Suche Tipps für Persormance-Steigerung (Geld für Nützliches) Beitragsarchiv 18 16.08.2005 10:57
Problem: Cannot modify header information Alpha Centauri PHP Tipps 2005 11 25.04.2005 13:05
update auf php 5.0.4 robo47 Server, Hosting und Workstations 6 10.04.2005 19:00
cannot modify header information!?!?! Fraylman PHP Tipps 2005 14 18.03.2005 18:14
Cannot modify header information - headers already sent PHP Tipps 2005 2 15.03.2005 22:10
Warning: Cannot modify header information ... PHP Tipps 2005 24 15.02.2005 11:07
Cannot modify header information PHP Tipps 2004-2 6 05.12.2004 19:37
admincontrolpanel: Cannot modify header information ? phpfortgeschrittener PHP Tipps 2004 2 23.08.2004 19:17
Warning: Cannot modify header... einbinden nicht möglich? PHP Tipps 2004 2 07.08.2004 15:06
Cannot modify header information - headers already sent by PHP Tipps 2004 2 25.07.2004 19:40
Warning: Cannot modify header information PHP Tipps 2004 8 22.07.2004 00:50

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
<input type=\radio\ name=\vote\ value=\1\ />, /poll,1.html <input type=\radio\ name=\vote\ value=\1\ />, echo $header.\\\n\.$data; warning cannot modify header

Alle Zeitangaben in WEZ +2. Es ist jetzt 04:56 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.