Hallo,
Ich habe ein Problem mit einer meiner php dateien, ich schaffe es einfach nicht eine Fehlermeldung wegzubekommen die immer hochpoppt wenn ich den header bearbeiten will.
ich habe auch schon in den anderen threads über dieses Thema rumgesucht und getestet, aber leider ohne erfolg...
Bitte um Hilfe
index.php
formular.php
bild.php
Die Fehlermeldung lautet
(Und ja ich weiß das man den code an etlichen stellen verbessern kann und 2 Datenbankverbindungen sowieso schwachsinn sind aber es geht mir gerade nur im diesen header Fehler)
Ich habe ein Problem mit einer meiner php dateien, ich schaffe es einfach nicht eine Fehlermeldung wegzubekommen die immer hochpoppt wenn ich den header bearbeiten will.
ich habe auch schon in den anderen threads über dieses Thema rumgesucht und getestet, aber leider ohne erfolg...
Bitte um Hilfe
index.php
HTML:
<html>
<body>
<div class="dark">
<style type="text/css">
body {
background: #fafafa url(dark_grey.jpg);
color: #444;
font: 100%/30px 'Helvetica Neue', helvetica, arial, sans-serif;
text-shadow: 0 1px 0 #fff;
}
strong {
font-weight: bold;
}
em {
font-style: italic;
}
table {
background: #f5f5f5;
border-collapse: separate;
box-shadow: inset 0 1px 0 #fff;
font-size: 12px;
line-height: 24px;
margin: 30px auto;
text-align: left;
width: 800px;
}
th {
background: url(images/noise-diagonal.png), linear-gradient(#777, #444);
border-left: 1px solid #555;
border-right: 1px solid #777;
border-top: 1px solid #555;
border-bottom: 1px solid #333;
box-shadow: inset 0 1px 0 #999;
color: #fff;
font-weight: bold;
padding: 10px 15px;
position: relative;
text-shadow: 0 1px 0 #000;
}
th:after {
background: linear-gradient(rgba(255,255,255,0), rgba(255,255,255,.08));
content: '';
display: block;
height: 25%;
left: 0;
margin: 1px 0 0 0;
position: absolute;
top: 25%;
width: 100%;
}
th:first-child {
border-left: 1px solid #777;
box-shadow: inset 1px 1px 0 #999;
}
th:last-child {
box-shadow: inset -1px 1px 0 #999;
}
td {
border-right: 1px solid #fff;
border-left: 1px solid #e8e8e8;
border-top: 1px solid #fff;
border-bottom: 1px solid #e8e8e8;
padding: 10px 15px;
position: relative;
transition: all 300ms;
}
td:first-child {
box-shadow: inset 1px 0 0 #fff;
}
td:last-child {
border-right: 1px solid #e8e8e8;
box-shadow: inset -1px 0 0 #fff;
}
tr {
background: url(images/noise-diagonal.png);
}
tr:nth-child(odd) td {
background: #f1f1f1 url(images/noise-diagonal.png);
}
tr:last-of-type td {
box-shadow: inset 0 -1px 0 #fff;
}
tr:last-of-type td:first-child {
box-shadow: inset 1px -1px 0 #fff;
}
tr:last-of-type td:last-child {
box-shadow: inset -1px -1px 0 #fff;
}
tbody:hover td {
color: transparent;
text-shadow: 0 0 3px #aaa;
}
tbody:hover tr:hover td {
color: #444;
text-shadow: 0 1px 0 #fff;
}
</style><br>
<h1 align="center" style="color:white">Übersicht:</h1>
<table>
<tr>
<th>ID</th>
<th>Name</th>
<th>Verkäufer</th>
<th>Preis</th>
<th>Kategorie</th>
<th>Einstellungsdatum</th>
<th>Ort</th>
<th>Plz</th>
<th>E-Mail</th>
</tr>
<?php include "formular.php"; ?>
</div>
</body>
</html>
formular.php
PHP:
<?php
$id = 5;
// Verbindung herstellen
$host = "****";
$user = "****";
$pass = "****";
$db = "****";
mysql_connect($host, $user, $pass);
mysql_select_db($db);
unset($host,$user,$pass,$db);
$query="select * from verkaufen_tbl order by ID ASC ";
$result = mysql_query($query);
while ($results = mysql_fetch_array($result))
{
echo"<p>
<tbody>
<tr>
<td><strong>".$results['id']."</strong></td>
<td>".$results['title']."</td>
<td>".$results['member']."</td>
<td>".$results['preis']." Euro</td>
<td>".$results['article']."</td>
<td>".$results['datum']."</td>
<td>".$results['ort']."</td>
<td>".$results['plz']."</td>
<td><b>E-Mail:</b><a href= mailto:".$results['mail'].">".$results['mail']."</a></td>
</tr></p></font>";
include "bild.php";
}
?>
bild.php
PHP:
<?header('Content-Type: image/jpg')?>
<?
$host = "****";
$user = "****";
$pass = "****";
$db = "****";
mysql_connect($host, $user, $pass);
mysql_select_db($db);
unset($host,$user,$pass,$db);
$sql = 'SELECT image FROM verkaufen_tbl WHERE id = 2';
$result = mysql_query($sql);
$bild = mysql_fetch_row($result);
echo $bild[0];
?>
Die Fehlermeldung lautet
Warning: Cannot modify header information - headers already sent by (output started at /****/****/****/****/index.php:110) in /****/****/****/****/bild.php on line 1
(Und ja ich weiß das man den code an etlichen stellen verbessern kann und 2 Datenbankverbindungen sowieso schwachsinn sind aber es geht mir gerade nur im diesen header Fehler)