min gem nyhed
session_start();
if($_SESSION['user_level'] == 1){
include("db.php");
$overskrift = $_POST["overskrift"];
$nyhed = $_POST["nyhed"];
$nyhed = htmlentities($nyhed, ENT_QUOTES);
$nyhed = ereg_replace(":D", "<img src=includes/images/smileys/cheesysmil.gif>", $nyhed);
$nyhed = ereg_replace(":-D", "<img src=includes/images/smileys/stortsmil.gif>", $nyhed);
$nyhed = nl2br($nyhed);
$dato = date('d/m/Y H:i:s');
mysql_query("INSERT INTO nyheder (overskrift, dato, nyhed) VALUES ('$overskrift', '$dato', '$nyhed')");
header("Location: ../skriv_nyhed.php");
}
?>
min vis nyhed
<?
session_start();
include("includes/db.php");
$query = mysql_query("SELECT * FROM nyheder ORDER BY id DESC LIMIT 0,5");
while($row = mysql_fetch_array($query)) {
echo"
<table class='tekstafsnit' width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td><b>$row[overskrift]</b> - <font color='#999999'>$row[dato]</font></td>
</tr>
<tr>
<td>
$row[nyhed]
</td>
</tr>
</table>
";
}
echo "<br/><a href=vis_alle_nyhed.php>Alle nyheder</a>";
?>
jeg går ud fra den bare skal bruges sådan min smileys virker