Tagwall error
HejJeg har problemer med tagwall som jeg har hentet her:
http://knaldhat.com/tagwall.zip - http://knaldhat.com/tagwall/
det drejer sig om denne fejl:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /var/www/hotels/1go/domain/html/tb/tagwall.php on line 126
jeg har problemer med mysql, er der nogen der kan få den til at køre med access eller .txt eller bare få den til at virke?
please
<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='7' width="272">
<tr>
<td width="127"><b><font size="2" face="Arial">Dit navn</font></b></td>
<td width="129"><b><font size="2" face="Arial">Din e-mail</font></b></td>
</tr>
<tr>
<td width="127"><input type='text' name='name' onfocus="if(this.value=='Name')this.value='';" onblur="if(this.value=='')this.value='Name';" size='21' style="font-family: Arial; font-size: 10 pt; font-weight: bold"></td>
<td width="129"><input type='text' name='email' onfocus="if(this.value=='E-mail')this.value='';" onblur="if(this.value=='')this.value='E-mail';" size='21' style="font-family: Arial; font-size: 10 pt; font-weight: bold; background-color: #FFFFFF; border-style: solid; border-width: 1"></td>
</tr>
<tr>
<td width="260" colspan="2"><b><font size="2" face="Arial">Din besked</font></b></td>
</tr>
<tr>
<td width="260" colspan="2"><textarea cols='51' rows='7' name='text' style="font-family: Arial; font-size: 10 pt; font-weight: bold"></textarea></td>
</tr>
<tr>
<td width="260" colspan="2"><input type='submit' name='send' value=' Post ' style="font-family: Arial; font-size: 10 pt; font-weight: bold; background-color: #FFFFFF; border-style: solid; border-width: 1"></form></td>
</tr>
<tr>
<td width="260" colspan="2"><b><font size="2" face="Arial">Skriv <br>
:) <img border="0" src="file:///C:/Documents%20and%20Settings/admin/Skrivebord/burgerk/tb/tagwall/glad.gif" width="20" height="20">
:( <img border="0" src="file:///C:/Documents%20and%20Settings/admin/Skrivebord/burgerk/tb/tagwall/sur.gif" width="20" height="20">
:'( <img border="0" src="file:///C:/Documents%20and%20Settings/admin/Skrivebord/burgerk/tb/tagwall/ked.gif" width="20" height="20">
:D <img border="0" src="file:///C:/Documents%20and%20Settings/admin/Skrivebord/burgerk/tb/tagwall/skratt.gif" width="20" height="20">
:P <img border="0" src="file:///C:/Documents%20and%20Settings/admin/Skrivebord/burgerk/tb/tagwall/cool.gif" width="20" height="20">
;) <img border="0" src="file:///C:/Documents%20and%20Settings/admin/Skrivebord/burgerk/tb/tagwall/ironi.gif" width="20" height="20"></font></b></td>
</tr>
</table>
<br><br>
<?php
//MySQL server configuration
$host = "host"; //Enter the address to your MySQL server
$user = "user"; //Enter the user to your MySQL server
$pass = "pass"; //Enter the password to your user
$db = "db"; //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);
$emotearr = array(":)",
":(",
":'(",
":D",
":P",
";)"
);
$emotetag = array("<img src='glad.gif'>",
"<img src='sur.gif'>",
"<img src='ked.gif'>",
"<img src='skratt.gif'>",
"<img src='cool.gif'>",
"<img src='ironi.gif'>"
);
$text = str_replace($emotearr, $emotetag, $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:%22.$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>
