Cannot modify header Infos mit Xampp New Release!

Alles, was PHP betrifft, kann hier besprochen werden.

Cannot modify header Infos mit Xampp New Release!

Postby traedamatic » 25. October 2006 17:58

Hallo Xampp Fans,

Ich hab ein echt komischen Problem. Bei mir zu hause stehen zwei Computer beide haben Xampp drauf, nur auf einem ist die neue Xamppversion (1.5.4) und die alte Version ist auf dem anderen Com. (XAMPP 1.4.15)

So immer wenn ich mein Script auf der neue Version ausführen will konnte dies:
Code: Select all
Cannot modify header information sent by...


Bei der älteren Version läuft mein Script super. Hat wer dafür eine Erklärung? Gibt es irgendein update in Php, das ich berücksichtigen muss?

gruß matic
traedamatic
 
Posts: 3
Joined: 25. October 2006 17:50

Postby Wiedmann » 25. October 2006 18:55

Dein Script ist wohl etwas schlampig programmiert...

(Ansonsten ist die Fehlermeldung ja hoffentlich klar?)
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby traedamatic » 25. October 2006 19:25

na dann poste ich mal mein script:

Code: Select all
<html>
<head>
<title>We love poker</title>
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body bgcolor="#000000"><center>
<table width="200" border="0" cellspacing="0" cellpadding="0" class="table">
  <tr>
    <td><img src="logo.jpg" width="750" height="100"></td>
  </tr>
  <tr>
    <td>
<div class="item">
<div class="item2"><a href="index.php" class="nav">Home</a></div>
<div class="item2"><a href="index.php?id=2" class="nav">Turnier</a></div>
<div class="item2"><a href="index.php?id=3" class="nav">Ranking</a></div>
<div class="item2"><a href="index.php?id=4" class="nav">Kontakt</a></div>
</div>
</td>
  </tr>
  <tr>
    <td>
<?php

    include('config.inc.php');
   
   $baseurl = "http://". $_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
   
   $id = $_GET["id"];
   
   if ($id == "1" || $id == "") {
   
   echo'<div class="content"><br><h1> WE ALL LOVE POKER </h1><br>';
   
   echo'Es ist soweit: <strong>Das erste Kollegen-Online-Poker Turnier</strong> wird noch in diesem Jahr stattfinden.
   <br>Alle Infos, die ihr zum pokern braucht findet ihr auf dieser Seite. <br>Ich werde immmer mal wieder die Seite aktualisiern, also schaut öfters mal vorbei!
   <br>
   <p>Gruß der TRAEDAMATIC</p>
   </div>
   ';
   
   }
   
   if ($id == "2") {
   echo'<div class="content"><br>';
   include('content/tournement.php');
   echo'</div>';
   }
   
   if ($id == "3") {
   echo'<div class="content"><br>';
   include('content/ranking.php');
   echo'</div>';
   }
   
   if ($id == "4") {
   echo'<div class="content"><br>';
   include('content/kontakt.php');
   echo'</div>';
   }
   
   
   if ($id == "10") {
   echo'<div class="content"><br>';
   include('content/anmeldung.php');
   echo'</div>';
   }
   
   if ($id == "11") {
   echo'<div class="content"><br>';
   
   $user = $_POST["user"];
   $pass = $_POST["passwort"];
   $skill = $_POST["skilllevel"];
   $time = $_POST["time"];
   $icq = $_POST["icq"];
   $skype = $_POST["skype"];
   $mail = $_POST["mail"];
   
   if ($user == "" || $pass == "")  {

   echo"Du musst die Felder User & Passwort ausfüllen";
      }
   else {
   
   $result_insert = mysql_query("INSERT $table_us (name, pass, skill, timepoker, icq, skype, mail) VALUES ('$user', '$pass','$skill','$time','$icq','$skype','$mail')") or mysql_error();
   
   echo mysql_error();
   
   if ($result_insert == 1) {  echo"du hast dich erfolgreich angemeldet! Wir freuen uns mit dir zu pokern!";  }
   
   echo'</div>';
   
   }
   
   }
   
if ($id == 12) {
header('Location: index.php');
}
?>
</td>
  </tr>
</table>
<br>
<a href="index.php?id=10" class="nav2">Anmelden</a>
</center>
</body>
</html>


gruß matic
traedamatic
 
Posts: 3
Joined: 25. October 2006 17:50

Postby Wiedmann » 25. October 2006 19:59

Die korrekte (und vollständige) Fehlermeldung?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby traedamatic » 25. October 2006 21:04

Die vollständige Fehlermeldung:

Code: Select all
Warning: Cannot modify header information - headers already sent by (output started at C:\Programme\xampp\htdocs\welovepoker\index.php:15) in C:\Programme\xampp\htdocs\welovepoker\index.php on line 99


und ich poste auch gleich die "config.ini.php" nich das ihr das gleich nach fragt:

Code: Select all
<?php

//mysql einstellungen

$host = "localhost";
$user = "root"; //web18
$password = "";//extaler
$db = "pokerlove";//pokerlove
$table_us = "user"; //poker_user

//Farben für Tabelle und so...

mysql_connect($host,$user,$password) or die("Keine Verbindung möglich!");

mysql_select_db($db);

?>


ich bin wirklich dankbar für eure Hilfe! Komme nämlich sonst nicht weiter.

gruß matic
traedamatic
 
Posts: 3
Joined: 25. October 2006 17:50

Postby sari42 » 25. October 2006 21:20

du könntest
Code: Select all
<?php ob_start(); ?>
vor das ganze geraffel setzen
sari42
 
Posts: 800
Joined: 27. November 2005 18:28

Postby Wiedmann » 25. October 2006 21:27

Warning: Cannot modify header information - headers already sent by (output started at C:\Programme\xampp\htdocs\welovepoker\index.php:15) in C:\Programme\xampp\htdocs\welovepoker\index.php on line 99

Code: Select all
99:  header('Location: index.php');

Ein Blick ins Manual hätte dir eigentlich die Frage beantwortet:
Vor der Funktion header() darf es keinen Output geben.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to PHP

Who is online

Users browsing this forum: No registered users and 11 guests