okk, here's the code
one thing i might note...is that on this website too. i clicked on my thread, and at first it only showed my original thread, but when i clicked refresh, the 2nd post showed up. strange? could be an IE setting rather than code relateD?
addgbookentry.php
<?
if (($POST[handle] == "") || ($POST[comment] == "")) {
header("Location: http://www.neoportal.net");
exit;
}
$db = "neoporta_guestbook";
$table = "guestbook";
$connection = @mysql_connect("localhost","name","pass") or die(mysql_error());
$db_select = @mysql_select_db($db,$connection) or die(mysql_error());
$sql = "insert into $table (id,handle,comment) values ('','$POST[handle]','$POST[comment]')";
$result = @($sql,$connection) or die(mysql_error());
echo "
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html>
<head>
<title>Neoportal.net</title>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<link rel='Stylesheet' type='text/css' href='/styles.css'>
</head>
<body>";
include("http://www.neoportal.net/header.htm");
echo "
<p align='center'>Your entry has been posted. THANKS!
<br><br>
<a href='http://www.neoportal.net'>Return Home</a> or <a href='/gbookread.php'>Read The Guestbook</a>";
include("http://www.neoportal.net/footer.htm");
echo "
</body>
</html>";
?>
gbookread.php
<?
$db = "neoporta_guestbook";
$table = "guestbook";
$connection = @mysql_connect("localhost","name","pass") or die(mysql_error());
$db_select = @mysql_select_db($db,$connection) or die(mysql_error());
$sql = "select id,handle,comment from $table order by id";
$result = @($sql,$connection) or die(mysql_error());
$num = @mysql_num_rows($result);
if ($num < 1) {
echo "
<html>
<head>
<title>Neoportal.net</title>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<link rel='Stylesheet' type='text/css' href='/styles.css'>
</head>
<body>";
include("http://www.neoportal.net/header.htm");
echo "<br><br><p align='center'><strong>Sorry</strong> No Entries yet";
include("http://www.neoportal.net/footer.htm");
echo "</body></html>";
} else {
echo "
<html>
<head>
<title>Neoportal.net</title>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<link rel='Stylesheet' type='text/css' href='/styles.css'>
</head>
<body>";
include("http://www.neoportal.net/header.htm");
echo "<h3 align='center'>Guestbook:<br><br>$display";
while ($row = mysql_fetch_array($result)) {
$comment = $row['comment'];
$handle = $row['handle'];
echo "
<br>
<table border=1 bordercolor=#000000 cellpadding=3 width=400 cellspacing=0>
<tr>
<td><p align='left'>$comment</td>
</tr>
<tr>
<td><p align='right'>--Posted by: $handle</td>
</tr>
</table>";
}
include("http://www.neoportal.net/footer.htm");
echo "
</body>
</html>";
}
?>