<?
if ($mode == "opret") {
$navn = ereg_replace("<","<",$navn);
$navn = ereg_replace(">",">",$navn);
$email = ereg_replace("<","<",$email);
$email = ereg_replace(">",">",$email);
$icq = ereg_replace("<","<",$icq);
$icq = ereg_replace(">",">",$icq);
$besked = ereg_replace("<","<",$besked);
$besked = ereg_replace(">",">",$besked);
$besked = ereg_replace("(\n\r|\r\n)","<br>",$besked);
if (ereg_replace("[0-9]","",$icq) == "") {
if ($besked == "") {
Echo "<P align=center><FONT face=Tahoma size=2><STRONG>Du skal nok lige skrive en besked ikk</STRONG></FONT></P>";
}
else {
if ($navn == "") {
Echo "<P align=center><FONT face=Tahoma size=2><STRONG>Du skal nok lige skrive dit navn ikk</STRONG></FONT></P>.";
}
else {
$fil = "tagwall.txt";
$tid = strftime("%d %B %Y", getlastmod()+3600);
$str = "<tr><td colspan=\"2\"><hr size=\"1\"></td></tr>\n<tr><td><FONT face=Tahoma size=2>Tid:</td><td><FONT face=Tahoma size=2>$tid</td></tr>\n</tr>\n<tr><td><FONT face=Tahoma size=2>Navn:</td><td><FONT face=Tahoma size=2>$navn</td></tr>\n<tr><td>Email:</td><td><a href=\"mailto:$email\"><FONT face=Tahoma size=2>$email</a></td></tr>\n<tr><td><FONT face=Tahoma size=2>Icq:</td><td><a href=\"
http://wwp.icq.com/scripts/search.dll?to=$icq\"><FONT face=Tahoma size=2>$icq</td></tr>\n<tr><td colspan=\"2\"><br><FONT face=Tahoma size=2>$besked</td></tr>\n";
$fp = fopen($fil, r);
if($fp) {
$filArray = file($fil);
$result = implode("", $filArray);
$result = "$str$result";
fclose($fp);
}
$fp = fopen($fil, w);
if($fp) {
fputs($fp, $result);
fclose($fp);
}
}
}
}
else {
echo "<P align=center><FONT face=Tahoma size=2><STRONG>Dit icq nummer er ugyldigt</STRONG></FONT></P>.";
}
$mode = "";
}
?>
<html>
<head>
<title>Tagwall V1.0</title>
</head>
<body bgcolor="#bec2c1" text="black" link="blue" vlink="blue" alink="blue">
<P align=center>
<FONT face=Tahoma size=2><STRONG>Tagwall V1.0</STRONG></FONT></P>
<?
if ($mode == "") {
?>
<P align=center><a href="default.php?mode=tilfoj"><FONT face=Tahoma size=2>Tilføj besked</FONT></a></P>
<table border="0" align="center">
<?
readfile("tagwall.txt");
?>
</table>
<?
}
?>
<?
if ($mode == "tilfoj") {
?>
<P align=center><a href="default.php"><FONT face=Tahoma size=2>Tilbage til forum</FONT></a></P>
<form action="default.php" method="post">
<input type="hidden" name="mode" value="opret">
<table border="0" align="center">
<tr><td><FONT face=Tahoma size=2>Navn:</FONT></td><td><input type="text" name="navn" style="background-color: Black; color: White; font-family: Tahoma; font-size: 10;"></td></tr>
<tr><td><FONT face=Tahoma size=2>Email:</FONT></td><td><input type="text" name="email" style="background-color: Black; color: White; font-family: Tahoma; font-size: 10;"></td></tr>
<tr><td><FONT face=Tahoma size=2>Icq:</FONT></td><td><input type="text" name="icq" style="background-color: Black; color: White; font-family: Tahoma; font-size: 10;"></td></tr>
<tr><td colspan="2"><textarea name="besked" cols="30" rows="8" style="background-color: Black; color: White; font-family: Tahoma; font-size: 10;"></textarea></td></tr>
<tr><td colspan="2"><input type="submit" value="Skriv" style="background-color: Black; color: White; font-family: Tahoma; font-size: 10;"></td></tr>
</table>
</form>
<?
}
?>
</body>
</html>
------------------
Det var så koden.
Du laver så en fil der hedder tagwall.txt ( en tom fil)( som brugers som database)