27.04.2005, 19:27
Hy ich bin grad an meinem newsscript und bi9n grad dabei auf ner extra seite (shownews.php) die komplette news anzuzeigen (weiter lesen und so) und jetzt kommt immer dieser fehler :
[php:1]<?php
include("config.php");
$query = mysql_query("SELECT id, title, autor, text, DATE_FORMAT(Datum, '%d.%m.%Y, %H.%i Uhr ') AS datum FROM news WHERE id='".$_GET['news_id']."' ORDER BY datum DESC");
while($news = mysql_fetch_array($query)) {
$id = $news[id];
$text = nl2br($news[text]);
$title = $news[title];
$autor = $news[autor];
$datum = $news[datum];
function HTML_News($id, $title, $datum, $text, $autor){
?>
<html>
<body>
<table width="400" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr>
<td bgcolor="#C5D0DE"><table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="274"><div align="left" class="news2"><strong><?php echo $title;?></strong></div></td>
<td width="126"><div align="right" class="news2"><?php echo $datum;?></div></td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><div align="left" class="news3"><?php echo $text;?></div></td>
</tr>
<tr>
<td bgcolor="#C5D0DE"><table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="112"><div align="left" class="news2"><a href="news.php?id=<?php echo $id; ?>">Weiter lesen ... </a></div></td>
<td width="288"><div align="right" class="news2">von: <?php echo $autor;?> </div></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?php
}
?>[/php:1]
(line 41 ist die letzte also : "?>")
Zitat:Parse error: parse error, unexpected $ in /srv/www/htdocs/web3/html/acp/news/shownews.php on line 41mein code :
[php:1]<?php
include("config.php");
$query = mysql_query("SELECT id, title, autor, text, DATE_FORMAT(Datum, '%d.%m.%Y, %H.%i Uhr ') AS datum FROM news WHERE id='".$_GET['news_id']."' ORDER BY datum DESC");
while($news = mysql_fetch_array($query)) {
$id = $news[id];
$text = nl2br($news[text]);
$title = $news[title];
$autor = $news[autor];
$datum = $news[datum];
function HTML_News($id, $title, $datum, $text, $autor){
?>
<html>
<body>
<table width="400" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr>
<td bgcolor="#C5D0DE"><table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="274"><div align="left" class="news2"><strong><?php echo $title;?></strong></div></td>
<td width="126"><div align="right" class="news2"><?php echo $datum;?></div></td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><div align="left" class="news3"><?php echo $text;?></div></td>
</tr>
<tr>
<td bgcolor="#C5D0DE"><table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="112"><div align="left" class="news2"><a href="news.php?id=<?php echo $id; ?>">Weiter lesen ... </a></div></td>
<td width="288"><div align="right" class="news2">von: <?php echo $autor;?> </div></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?php
}
?>[/php:1]
(line 41 ist die letzte also : "?>")
