Bei mir kommt folgender Fehler:
Warning: Cannot add header information - headers already sent by (output started at /usr/local/httpd/htdocs/phpMyInventory/var.inc.php:12) in /usr/local/httpd/htdocs/phpMyInventory/gb.php on line 139
vielleicht kann mir irgendjemand helfen, und mir sagen, woran es liegt!
Hier der Code von var.inc.php
	
hier der Code von gb.php
	
							
						
					Warning: Cannot add header information - headers already sent by (output started at /usr/local/httpd/htdocs/phpMyInventory/var.inc.php:12) in /usr/local/httpd/htdocs/phpMyInventory/gb.php on line 139
vielleicht kann mir irgendjemand helfen, und mir sagen, woran es liegt!
Hier der Code von var.inc.php
PHP-Code:
	
	
<?php
    // Datenbank Variablen
    
    $dbserver     = "localhost";
    $dbname     = "inventory";
    $dbuser     = "inventory";
    $dbpass        = "20074054";
    
    // Sonstige Variablen
    
    $beitraege    = 5;
?> <------------------------ Zeile 12
PHP-Code:
	
	
<?php
    include('var.inc.php');
    include "includes/header.inc.php";
    include "includes/user_func.inc.php";
    
    if (!isset($aktion))
        {
            $aktion = "show";
        }
    if (!isset($seite))
        {
            $seite = 1;
        }
    if ($aktion == "show")
        {
            echo"<html>".
                "<head>".
                "<title>Help</title>".
                "</head>".
                "<body>";
            $conn = mysql_connect($dbserver,$dbuser,$dbpass);
            mysql_select_db($dbname,$conn);
            $anfang = ($seite-1)*$beitraege+1;
            $ende = $anfang+$beitraege-1;
            $query = "SELECT * FROM gb ORDER BY datum DESC";
            $result = mysql_query($query,$conn);
            $gesamt = mysql_num_rows($result);
            if ($gesamt == 0)
                {
                    echo "No Entries!";
                }
            $counter = 1;
            if ($ende > $gesamt) { $ende = $gesamt; }
            echo"<table cellspacing=\"2\" cellpadding=\"2\" border=\"1\" align=\"center\">";
            while ($zeileholen = mysql_fetch_array($result,MYSQL_ASSOC))
                {
                    if (($counter >= $anfang) AND ($counter <= $ende))
                        {
                            echo"<tr width=\"25%\">".
                                    "<td>geschrieben von :<br>".stripslashes($zeileholen["name"])."<br>eMail :".stripslashes($zeileholen["email"])."</td>".
                                    "<td colspan=\"2\" width=\"75%\">Titel : ".stripslashes($zeileholen["titel"])."</td>".
                                 "</tr>".
                                "<tr>".
                                    "<td>am ".$zeileholen["datum"]."</td>".
                                    "<td colspan=\"2\">".stripslashes(nl2br(htmlentities($zeileholen["beitrag"])))."</td>".
                                "</tr>";
                        }
                    $counter++;
                }
            echo "<tr><td>";
            if ($seite == 1)
                {
                    echo" ";
                }
            else
                {
                     echo"<a href=\"gb.php?aktion=show&seite=".($seite-1)."\">zurück</a>";
                }
            echo"</td><td><a href=\"gb.php?aktion=edit\">New Entry</a></td><td>";
            if ($ende >= $gesamt)
                {
                    echo" ";
                }
            else
                {
                     echo"<a href=\"gb.php?aktion=show&seite=".($seite+1)."\">weiter</a>";
                }  
            echo"</td><td><a href=gbsucheneu.php> Search</a></td><td>"; 
            if($ende >= $gesamt)
                {
                    echo " ";
                }  
            echo "</td></tr>";    
            echo"</table>";             
        }
        
    if ($aktion == "edit")
        {
            echo"<html>".
                "<head>".
                "<title>Help</title>".
                "</head>".
                "<body>";
            echo "<h4>Write new Entry :</h4>";
            echo"<form action=\"gb.php?aktion=insert\" method=\"post\">".
                    "<table cellspacing=\"2\" cellpadding=\"2\" border=\"0\">".
                        "<tr>".
                            "<td>Name : </td>".
                            "<td><input type=\"text\" name=\"name\" size=\"30\" maxlength=\"50\"></td>".
                        "</tr>".
                        "<tr>".
                            "<td>eMail : </td>".
                            "<td><input type=\"text\" name=\"email\" size=\"30\" maxlength=\"50\"></td>".
                        "</tr>".
                    
                        "<tr>".
                            "<td>Title :</td>".
                            "<td><input type=\"text\" name=\"titel\" size=\"30\" maxlength=\"100\"></td>".
                        "</tr>".
                        "<tr>".
                            "<td>System :</td>".
                            "<td><input type=\"text\" name=\"system\" size=\"30\" maxlength=\"100\"></td>".
                        "</tr>".
                        "<tr>".
                            "<td>Hardware : </td>".
                            "<td><input type=\"text\" name=\"hardware\" size=\"30\" maxlength=\"50\"></td>".
                        "</tr>".
                        "<tr>".
                            "<td>Software : </td>".
                            "<td><input type=\"text\" name=\"software\" size=\"30\" maxlength=\"50\"></td>".
                        "</tr>".
                        "<tr>".
                            "<td>Department : </td>".
                            "<td><input type=\"text\" name=\"abteilung\" size=\"30\" maxlength=\"50\"></td>".
                        "</tr>".
                        "<tr>".
                            "<td>Contribution :</td>".
                            "<td><textarea cols=\"40\" rows=\"15\" name=\"beitrag\"></textarea></td>".
                        "</tr>".
                        "<tr>".
                            "<td><input type=\"submit\" name=\"sub\" value=\"Send Entry\"></td>".
                            "<td><input type=\"reset\" name=\"res\" value=\"Reset\"></td>".
                        "</tr>".
                    "</table>".
                "</form>"; 
        }
    if ($aktion == "insert")
        {
            $conn = mysql_connect($dbserver,$dbuser,$dbpass);
            mysql_select_db($dbname,$conn);
            $datum = date("Y-m-d H:i:s",time());
            $query = "INSERT INTO gb VALUES ('', '".addslashes($name)."', '".addslashes($email)."', '".addslashes($titel)."','".addslashes($system)."','".addslashes($hardware)."','".addslashes($software)."', '".addslashes($abteilung)."', '".addslashes($beitrag)."' ,'".$datum."')";
            $result = mysql_query($query,$conn);
            if (!$result)
                {
                    die ("Sorry, Datenbankeintrag hat nicht funktioniert"); 
                }
            mysql_close($conn);
            header("Location:gb.php"); <------------------Zeile 139
        }
  
        
?>
</body>
</html>
 
          



 
							
						 
							
						
Kommentar