<?php
error_reporting(E_ALL);
include ('../inc/config.php');
// Konfigurationsdatei laden
@mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) OR die(mysql_error());
@mysql_select_db('Verein') OR die('Kann keine Verbindung zur Datenbank herstellen');
$query = 'SELECT ID,Titel,Autor,Email,Homepage,Inhalt,Datum FROM news';
if($sql = @mysql_query($query))
{
echo '<h1 align="center">News editieren</h1>';
echo '<table border="1" align="center" width="800" cellsparring="5">';
echo '<form method="post" action="edit_news.php">';
while($row = mysql_fetch_assoc($sql))
{
echo '<tr><td align="center" width="50"><b>'.$row['ID'].'</b></td>';
echo '<th colspan="6" align="center">geschrieben am: '.$row['Datum'].'</th>';
echo '</tr>';
echo '<tr>';
echo '<td align="center">Autor</td>';
echo '<td align="left"><input type="text" name="Autor" value="'.$row['Autor'].'"></input></td>';
echo '<td align="center" width="200">E-Mail</td>';
echo '<td align="left"><input ype="text" name="Email" value="'.$row['Email'].'"></input></td>';
echo '<td align="center" width="200">Homepage</td>';
echo '<td align="left"><input type="text" name="Homepage" value="'.$row['Homepage'].'"></input></td>';
echo '</tr>';
echo '<tr></tr>';
echo '<tr>';
echo '<td align="center">Titel</td>';
echo '<th align="center" colspan="5"><input size="50" type="text" name="Titel" value="'.$row['Titel'].'"></input></th>';
echo '</tr>';
echo '<tr>';
echo '<td align="center">Inhalt</td>';
echo '<th colspan="5" height="30"><textarea name="Inhalt" cols="57" rows="15">'.$row['Inhalt'].'</textarea></th>';
echo '</tr>';
}
echo '</table>';
echo '<td>';
echo '<input type="submit" value="Ändern"></input>';
echo '</td>';
echo '</form>';
}
?>