Der findes massere af tagwall rundt om på nettet, en jeg selv har lavet:
Tagwall.php
<?php
$connection = mysql_pconnect("host","user","pass") or die(mysql_error());
mysql_select_db("db") or die(mysql_error());
if($_POST[skriv]){
if($_POST[navn] && $_POST[besked]){
if($_POST[mail]<>"")
{
$mailtjek = eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$",$_POST[mail]);
if($mailtjek==0)
{
$error = 1;
}}}else{
$error = 2;
}
if(!$error){
$_POST[besked] = addslashes($_POST[besked]);
$_POST[besked] = ereg_replace("<([^>]+)>", "", $_POST[besked]);
$_POST[site] = "
http://$_POST[site]";$_POST[site] = ereg_replace("http://([a-zA-Z0-9@:%_.~#-\?&]*)", "<a target=_blank href=\"
http://\\1\">\\1</a>", $_POST[site]);
$insertSQL = "insert into tagwall (navn, mail, site, besked, dato) values ('$_POST[navn]', '$_POST[mail]', '$_POST[site]', '$_POST[besked]', now())";
mysql_query($insertSQL);
header("Location: tagwall.php");
}}
?>
<html>
<head>
<title>Tagwall</title>
<style>
body{font-size: 11px; font-family: tahoma; color: #FFFFFF; background-color: #24272F;}
table{font-size: 11px; font-family: tahoma; color: #FFFFFF; }
A:link {text-decoration: none; color: #FFFFFF;}
A:visited {text-decoration: none; color: #FFFFFF;}
A:active {text-decoration: none; color: #FFFFFF;}
A:hover {text-decoration: none; color: #C0C0C0;}
</style>
</head>
<body>
<?php
if($error == 1){ echo "Den indtastede mail er <b>ikke</b> korrekt.<br>"; }
if($error == 2){ echo "Du mangler at udfylde nogle felter"; }
?>
<b>
<form method="post" action="tagwall.php">
Navn:<br>
<input type="text" name="navn" size="30" maxlength="30" style="color: #000000;background-color: #ffffff;border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; font-size: 8pt; font-family: Verdana; color: #000000; font-weight: bold;" value="<?php echo $_POST[navn]; ?>"><br>
E-Mail:<br>
<input type="text" name="mail" size="30" maxlength="100" style="color: #000000;background-color: #ffffff;border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; font-size: 8pt; font-family: Verdana; color: #000000; font-weight: bold;" value="<?php echo $_POST[mail]; ?>"><br>
Hjemmeside:<br>
<input type="text" name="site" size="30" maxlength="100" style="color: #000000;background-color: #ffffff;border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; font-size: 8pt; font-family: Verdana; color: #000000; font-weight: bold;" value="<?php echo $_POST[site]; ?>"> (uden http://)<br>
Besked:<br>
<textarea wrap="virtual" rows="5" name="besked" cols="40" style="color: #000000;background-color: #ffffff;border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; font-size: 8pt; font-family: Verdana; color: #000000; font-weight: bold;"><?php echo $_POST[besked]; ?></textarea><br>
<input type="submit" name="skriv" value="Skriv" style="color: #000000;background-color: #ffffff;border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; font-size: 8pt; font-family: Verdana; color: #000000; font-weight: bold;">
</form>
</b></font>
<br><br>
</body>
</html>
<?php
$visfra = $_GET[visfra];
if(!$_GET[visfra])
{
$visfra = 0;
}
$query = mysql_query ("SELECT * FROM tagwall ORDER BY id DESC limit $visfra, 10");
while ($row = mysql_fetch_array($query)) {
echo "<table width='500' bgcolor='#333742' style='border-collapse: collapse;' cellpadding='3'>";
echo "<tr><td style='border: 1px solid black;'><span style='float: right;'>$row[dato]</span><span style='text-align:left;'>";
echo "<a href='mailto: $row[mail]'><b>$row[navn]</b></a> <a href='$row[site]'>$row[site]</a></span></td></tr>";
echo "<tr><td style='border-left: 1px solid black; border-right: 1px solid black; border-bottom: 1px solid black;'>".nl2br(stripslashes($row[besked]))."</td></tr>";
echo "</table><br>";
}
$antal = mysql_num_rows(mysql_query("SELECT id FROM tagwall"));
if($visfra>0)
{
$bagud = $visfra-10;
echo "<a href='$PHP_SELF?visfra=$bagud'>Forrige</a> ";
}
$page = 1;
for($start=0; $antal > $start; $start=$start+10){
if($visfra != $page*10-10)
{
echo "<a href='$PHP_SELF?visfra=$start'>$page</a> ";
}else{
echo $page." ";
}
$page = $page+1;
}
if($visfra< $antal-10)
{
$naeste = $visfra+10;
echo " <a href='$PHP_SELF?visfra=$naeste'>Næste</a>";
}
mysql_close($connection);
?>
Tabelstruktur:
# phpMyAdmin MySQL-Dump
# version 2.5.0
#
http://www.phpmyadmin.net/ (download page)
#
# Vært: localhost
# Genereringstidspunkt: 17/05 2003 kl. 14:24:34
# Server version: 4.0.12
# PHP version: 4.3.0
# Database: : `exp`
# --------------------------------------------------------
#
# Struktur dump for tabellen `tagwall`
#
# Creation: 17/05 2003 kl. 14:24:20
# Last update: 17/05 2003 kl. 14:24:28
#
CREATE TABLE `tagwall` (
`id` int(11) NOT NULL auto_increment,
`navn` varchar(40) NOT NULL default '',
`mail` varchar(150) NOT NULL default '',
`site` varchar(200) NOT NULL default '',
`besked` text NOT NULL,
`dato` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;
Ellers kan du se lidt på denne:
http://clint-mathis.starthotel.dk/php/se.php?id=3