nu får i hele koden
tagwall.php
<?
if($navn && $tag) {
$tag = ereg_replace("<","<",$tag);
$tag = ereg_replace(">",">",$tag);
$fil = "tagwall.txt";
$mam = time() - 7200;
$tid = date("[G:i:s]",$mam);
$str = "$tid <$navn> $tag<br>";
$fp = fopen($fil, r);
if($fp) {
$filArray = file($fil);
$result = implode("", array_reverse ($filArray));
$result = "$str$result";
fclose($fp);
}
$fp = fopen($fil, w);
if($fp) {
fputs($fp, $result);
fclose($fp);
}
header("location: index.php?site=tagwall");
}
?>
<form action="tagwall.php" method="post">
<table border="0" align="center" cellspacing="0" cellpadding="0">
<tr>
<td>
<b>Navn</b>
<td>
<b>Tag:</b>
</td>
<td>
</td>
</tr>
<tr>
<td>
<input type="text" name="navn" maxlength="40">
</td>
<td>
<input type="text" name="tag" size="40" maxlength="200">
</td>
<td>
<input type="submit" name="skriv" value="Skriv">
</td>
</tr>
</table>
</form>
<table width="550" border="1" bordercolor="#000000" align="center" cellspacing="0" cellpadding="0" class="tagwall">
<tr><td>
<?
readfile("tagwall.txt");
?>
</td></tr>
</table>
</html>
den skriver så til tagwall.txt som er chmodet til 766
tagwall.php bliver includet i index.php
Hilsen
Martin Dybdal (Dybber)