Well I followed an online tut and the person didn't help me with my errors at all.
Heres my code:
[PHP]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="imagetoolbar" content="no">
<link rel="stylesheet" href="common.css" type="text/css">
<base target="_self">
<title>Chat</title>
</head>
<body class="shoutboxbody" style="overflow-x: hidden;">
<?
$filename = "./shoutdb.txt";
$usemask = "yes";
$link_mask = "[link]";
$email_mask = "[email]";
/*
Smileys
*/
$smileydir = './images/';
/*
Define Smileys
*/
$smileys = array (
"[

]" => "smile.gif",
"[

)]" => "lol.gif",
"[

]" => "sad.gif",
);
/*
Prepare Smileys
*/
function alter_smiley(&$item1, $key, $prefix) {
$item1 = " <img alt=\"\" src=\"$prefix$item1\" align=\"middle\" border=\"0\" />";
}
/*
Bad Words Filter
*/
function removeBadWords(&$text) {
$badwords = array(
"/fu
.ck/",
"/sh
.it/"
);
for ($i=0;$i<count($badwords);$i++)
$text = preg_replace($badwords[$i], "[

]", $text);
}
/*
Save posts to database
*/
extract($_POST);
/*
Display Errors
*/
$errorMsg = "";
/*
Excutes script once submit is clicked
*/
if($submit) {
if(!$name) $errorMsg.="You need to enter a name!<br>";
elseif(!$shout) $errorMsg.="You need to enter text to send!<br>";
elseif(($name=="Name") || ($shout=="Message")) $errorMsg.="Say something!<br>";
else {
if($site) $author = "<a href='$site'>$name</a>";
else $author = $name;
$handle = fopen($filename,"a");
$date = strftime("%D");
$time = strftime("%T");
$ipaddr = $REMOTE_ADDR;
removeBadWords($shout);
/*
Write the code to txt file
*/
$data = "$date | $time | $author | $ipaddr | $shout\,";
fwrite($handle, "$data");
fclose($handle);
}
}
echo $errorMsg;
echo "<table class=\"SB_formarea\" width=\"100%\" border=\"0\">\n";
echo "<tr><td>\n";
echo "<form method=\"post\" action=\"shout.php\">\n";
echo "<div align=\"center\"><input type=\"text\" name=\"name\" size=\"16\" value=\"Name\" maxlength=\"14\" title=\"Name\" class=\"SB_input\"><br>\n";
echo "<input type=\"text\" name=\"shout\" size=\"16\" value=\"Message\" maxlength=\"1024\" title=\"Message\" class=\"SB_input\"><br>\n";
echo "<input type=\"submit\" name=\"submit\" value=\":: send ::\" class=\"SB_button\">\n";
echo "<input type=\"button\" name=\"refresh_it\" value=\"::\" class='SB_button' onclick=\"window.open('shout.php','_self');\">\n";
echo "</div></td></tr></form></table>\n";
$shouts = file($filename);
$rowColor = 0;
$count = 0;
array_walk ($smileys, 'alter_smiley', $smileydir);
krsort($shouts);
$link_search = array("/\</",
"/\>/",
"/\]/",
"/\[/",
"#([\n ])([a-z0-9\-_.]+?)@([^, \n\r]+)#i",
"#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^, \n\r]*)?)#i",
"/(?<!<a href=\")((http|ftp)+(s)?:\/\/[^<>\s]+)/i");
if ($usemask=='yes')
$link_replace = array("<",
">",
">",
"<",
"
\\1<a href=\"<A href="mailto:\\2@\\3\">".$email_mask."</a">mailto:\\2@\\3\">".$email_mask."</a>",
"
\\1<a href=\"