Tilføje smileys til tagwall
HejEr der nogen her der kan hjælpe mig med at tilføje 7 smileys til denne tagwall?
på forhånd tak
<html>
<head>
<style type='text/css'>
body {
font-family: Trebuchet MS;
color: #000000;
font-size: 10pt;
}
INPUT {
border: 1px solid;
color: #000000;
}
TEXTAREA {
border: 1px solid;
color: #000000;
}
A {
text-decoration: none;
color: #000000;
}
A:hover {
text-decoration: underline;
}
</style>
<title>Tagwall made by Kasper Andersen</title>
</head>
<body>
<form method='post' action=''>
<table cellspacing='3'>
<tr>
<td><input type='text' name='name' value='Name' onfocus="if(this.value=='Name')this.value='';" onblur="if(this.value=='')this.value='Name';" size='22'></td>
</tr>
<tr>
<td><input type='text' name='email' value='E-mail' onfocus="if(this.value=='E-mail')this.value='';" onblur="if(this.value=='')this.value='E-mail';" size='22'></td>
</tr>
<tr>
<td><textarea cols='30' rows='7' name='text'></textarea></td>
</tr>
<tr>
<td><input type='submit' name='send' value='Post'></form></td>
</tr>
</table>
<br><br>
<?php
//MySQL server configuration
$host = "localhost"; //Enter the address to your MySQL server
$user = "knaldhat"; //Enter the user to your MySQL server
$pass = "fdokty54"; //Enter the password to your user
$db = "knaldhat"; //Enter the database on your MySQL server where you created the table from the structure.sql
//Do not modify anything under this line!
//Get the input typed in the form
$name = $_POST['name'];
$email = $_POST['email'];
$text = $_POST['text'];
$time = date("d/m-Y H:i:s");
//If nothing was typed in the name field, then the Name will be replaced with 'anonymous'
if ($_POST['name'] == "Name") {
$name = "Anonymous";
}
//If nothing was typed in the E-mail field, then the E-mail will be replaced with null@null
if ($_POST['email'] == "E-mail") {
$email = "null@null";
}
//Connect to the MySQL server
mysql_connect("$host", "$user", "$pass");
//Select a database
mysql_select_db($db);
//If the text field isn't empty, then this code will be executed:
//If an URL was typed in the text field, then it will be replaced with <a href='http://somedomain.com'>http://somedomain.com</a>
//If an < or > has been typed, it will be replaced with < or >
//Insert the data into the MySQL database
if(!empty($_POST['text'])){
$text = ereg_replace("<", "<", $text);
$text = ereg_replace(">", ">", $text);
$text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\">\\0</a>", $text);
$insertSQL = "insert into tagwall (name, email, time, text) values ('$name', '$email', '$time', '$text')";
mysql_query($insertSQL);
}
//Get all the data from the MySQL database, sort by the row 'id' and limit the rows that's being printed to 20
//Make an array from the $result variable
//Convert the 'new line's to <br>
$result = mysql_query("SELECT * FROM tagwall ORDER BY id DESC LIMIT 20") or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
echo "<font family='Trebuchet MS, sans-serif' size='2'><b><a href='mailto:".$row['email']."'>".$row['name']."</a></b> - ".$row['time']."<br>";
echo nl2br($row['text']);
echo "<br><br>";
}
//Close the connection to the MySQL server
mysql_close();
?>
<br><br>
</body>
</html>