if(($_POST["mit"]) == 'preview') {
$content = $_POST["content"];
$content1 = $_POST["content"];
$user_name = $_POST["user_name"];
$email = $_POST["email"];
$website = $_POST["website"];
$content = addslashes("$content");
$content = str_replace("[hr]", "<hr>", $content);
$content = str_replace("[b]", "<b>", $content);
$content = str_replace("[/b]", "</b>", $content);
$content = str_replace("[i]", "<i>", $content);
$content = str_replace("[/i]", "</i>", $content);
$content = str_replace("[u]", "<u>", $content);
$content = str_replace("[/u]", "</u>", $content);
$content = preg_replace("!\\[url\\]www.(.*)\\[/url\\]!Usi", "<a href=\"http://www.\\1\" target=_blank>\\1</a>",$content);
$content = preg_replace("!\\[url\\](.*)\\[/url\\]!Usi","<a href=\"\\1\" target=_blank>\\1</a>",$content);
$content = preg_replace("!\\[url=(.*)\\](.*)\\[/url\\]!Usi","<a href=\"\\1\" target=_blank>\\2</a>",$content);
$content = preg_replace("!\\[img\\](.*)\\[/img\\]!Usi","<img src=\"http://\\1\" border=0>",$content);
$content = preg_replace("!\\[email\\](.*)\\[/email\\]!Usi","<a href=\"mailto:\\1\">\\1</a>",$content);
$date = time("Y-m-d");
print ("<table width=\"70%\" cellpadding=\"0\" cellspacing=\"0\" class=\"guest\"><tr><td>
<table width=\"100%\" class=\"topguest\">
<tr><td align=\"left\"");
if($email && $website == null) { echo (" width=\"100%\" "); } else { echo (" width=\"48%\" ");
echo ("bgcolor=\"#1522BF\">Post by - $username on $date</td>");
if (($email != null) || ($website !=null)) {
echo ("
<td width=\"4%\" valign=\"middle\">||</td><td align=\"right\" width=\"48%\" bgcolor=\"#1522BF\">");
if($email != null) { echo("
[@] <a href=\"mailto:$email\">$email</a> - "); }
if($website != null) { echo("[www] <a href=\"$website\" target=_blank>$website</a>"); }
}
echo(" BLAH BLAH - not important");
include("guest_form.php");
} elseif(($_POST["mit"]) == "save") { ###line 51 ###
$sql = " INSERT INTO guestbook (user_name, email, website, content, date) VALUES ('$user_name','$email','$website','$content','$date') ";
$fed = mysql_db_query($db_name,$sql);
if(!$fed) { echo("<p align=\"guestbook.php\">Sorry this function isn't working at the moment. Click <a href=\"guestbook.php\">here</a> to be taken back to the guestbook.</p>"); } else {
header("Location: guestbook.php");
}
}
ok that is all the code that is relevant, and the error is
Parse error: parse error in /data/sites/4778115049/www/web/pages/guestbook.php on line 51
there is another else after the closing