Det var da utroligt....det virker stadig ikke...ved ikke om det vil hjælpe min nu poster jeg lige sourcen til min gb!
guestbook.php<?
if ($_POST['submit_gb']){
$db = mysql_connect ("localhost","**","**");
mysql_select_db ("**" , $db);
$navn = $_POST['navn'];
$emne = $_POST['emne'];
$besked = $_POST['besked'];
$dato = date("l d.m.Y \\k\\l\\. G:i");
$ip = $REMOTE_ADDR;
$navn = htmlentities($navn);
$emne = htmlentities($emne);
$besked = htmlentities($besked);
$besked = ereg_replace(":-)", "<img border=0 src=smileys/happy.gif>", $besked);
$besked = ereg_replace("
", "<img border=0 src=smileys/happy.gif>", $besked);
$besked = ereg_replace(":-D", "<img border=0 src=smileys/veryhappy.gif>", $besked);
$besked = ereg_replace("
", "<img border=0 src=smileys/veryhappy.gif>", $besked);
$besked = ereg_replace(":-\\(", "<img border=0 src=smileys/sad.gif>", $besked);
$besked = ereg_replace(":\\(", "<img border=0 src=smileys/sad.gif>", $besked);
$dato = eregi_replace("Monday","Mandag","$dato");
$dato = eregi_replace("Tuesday","Tirsdag","$dato");
$dato = eregi_replace("Wednesday","Onsdag","$dato");
$dato = eregi_replace("Thursday","Torsdag","$dato");
$dato = eregi_replace("Friday","Fredag","$dato");
$dato = eregi_replace("Saturday","Lørdag","$dato");
$dato = eregi_replace("Sunday","Søndag","$dato");
mysql_query ("INSERT INTO guestbook (navn,emne,besked,dato,ip) values('$navn','$emne','$besked','$dato','$ip')");
$msg = "Din besked er gemt";
}//lukker if sætningen som tjekker om submit knappen er aktiveret
?>
<html>
<head>
<title>Red Barmen - Gæstebog</title>
</head>
<body bgcolor="black" link="red" vlink="red" alink="red">
<font color="red" face="microsoft sans serif">
<p align="center">
<b>Skriv i gæstebogen</b><br>
</p>
<p>
<form method="post" action="<?php print $_SERVER['PHP_SELF'] ;?>"><br>
<b>
Navn:<br>
<input type="text" name="navn" value=" " size="40"><br>
Emne:<br>
<input type="text" name="emne" size="40"><br>
Besked:<br>
</b>
<textarea cols="30" rows="15" name="besked"></textarea><br><br>
<p align="center">
<input type="submit" name="submit_gb" value="Gem besked">
<input type="reset" value="Slet">
</form>
</p>
<?php
print("$msg");
?>
<p align="center">
<a href="showguestbook.php">Klik her for at se gæstebogen</a>
</p>
</font>
</body>
</html>
[/pre]
showguestbook.php<html>
<head>
<link rel="stylesheet" href="/css/gbook.css" type="text/css">
<title>Red Barmen - Gæstebog</title>
</head>
<body bgcolor="black" text="red" link="red" vlink="red" alink="red">
<p align="center"><font face="charlesworth">Red Barmens gæstebog
<br><br>
</font>
<font face="charlesworth" size="2">
<a href="guestbook.php">Skriv i gæstebogen</a>
</font>
</p>
<?php
$db = mysql_connect ("localhost","**","**");
mysql_select_db ("**" , $db);
$sql = mysql_query("SELECT * FROM guestbook");
while($row = mysql_fetch_array($sql)) {
echo "<table><tr><td><p><font face='microsoft sans serif' size=2><b>Dato: </b> ".$row['dato']."</font></p></td></tr></table>";
echo "<table><tr><td><p><font face='microsoft sans serif' size=2><b>Navn:</b> ".$row ['navn']."</font></p></td></tr></table>";
echo "<table><tr><td><p><font face='microsoft sans serif' size=2><b>Emne:</b> ".$row['emne']."</font></p></td></tr></table>";
echo "<table class=last><tr><td><p><font face='microsoft sans serif' size=2><b>Besked:</b><br>".$row['besked']."</font></p></td></tr></table>";
print "<br>";
//lukker while løkken
}
?>
</body>
</html>
[/pre]
-------------------------------------------------------
Jonas (Decko)
http://www.growyourownshit.com/users/Decko-------------------------------------------------------