Coding eines Newssystems in PHP ... die IF-Abfrage wird aber leider als Text ausgegeben, warum?
PHP-Code:
while($row = mysql_fetch_array($newsdb))
{
$anzeige = "<a name=\"{$row[newsid]}\"></a><table width=\"100%\" border=\"1\" bordercolor=\"#000000\"><tr bordercolor=\"#000000\"><br>
<td class=\"sttnormal\" width=\"16%\" bordercolor=\"#FFFFFF\">{$row['typ']}<br>{$row['stil']}</td>
<td class=\"sttbold\" width=\"84%\" bordercolor=\"#FFFFFF\">{$row['titel']}<br>
<span class=\"italic\">{$row['untertitel']}</span></td></tr><br>
<tr bordercolor=\"#000000\"><td class=\"sttnormal\" width=\"16%\">
if ($typ == 'Enterprise')
{
echo('<img src=\"pic/ent2.gif\" width=\"33\" height=\"15\">');
}
elseif ($typ == 'Voyager')
{
echo('<img src=\"pic/voy2.gif\" width=\"33\" height=\"15\">');
}
elseif ($typ == 'Raumschiff Enterprise')
{
echo('<img src=\"pic/tos2.gif\" width=\"33\" height=\"15\">');
}
elseif ($typ == 'Kinofilme')
{
echo('<img src=\"pic/mov2.gif\" width=\"33\" height=\"15\">');
}
elseif ($typ == 'Next Generation')
{
echo('<img src=\"pic/tng2.gif\" width=\"33\" height=\"15\">');
}
elseif ($typ == 'Deep Space Nine')
{
echo('<img src=\"pic/ds92.gif\" width=\"33\" height=\"15\">');
}
elseif ($typ == 'Website')
{
echo('<img src=\"pic/stt2.gif\" width=\"33\" height=\"15\">');
}
else
{
echo('<img src=\"pic/d122.gif\" width=\"33\" height=\"15\">');
}
</td><br>
<td class=\"sttnormal\" width=\"84%\" bordercolor=\"#FFFFFF\">{$row['beitrag']}<br></td></tr><br>
<tr bordercolor=\"#000000\"><td class=\"klein\" width=\"16%\" bordercolor=\"#FFFFFF\"><br>
Quelle: {$row['quelle']}</td><td class=\"klein\" width=\"84%\" bordercolor=\"#FFFFFF\"><br>
<div align=\"right\">verfasst von {$row['autor']} um {$row['zeit']} Uhr</div></td></tr></table><br>";
}
echo($anzeige);
Kommentar