Ankündigung

Einklappen
Keine Ankündigung bisher.

Warning: Cannot modify header information....

Einklappen

Neue Werbung 2019

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • 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>";
    
    
    ?>


  • #2
    Re: Warning: Cannot modify header information....

    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

    Kommentar


    • #3
      Was ist denn da falsch?

      Kommentar


      • #4
        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

        Kommentar


        • #5
          Danke meikel

          Danke meikel!

          Wieder hat eine Deiner Antworten geholfen!!!

          Ich werde mal mehr mit php.net arbeiten!

          php123

          Kommentar

          Lädt...
          X