Notice: Use of undefined constant message - assumed 'message' in d:\easyphp\www\gb\index.php on line 26
Notice: Use of undefined constant author - assumed 'author' in d:\easyphp\www\gb\index.php on line 28
I get the ugly notices when testing on localhost. how to remove them?
Code: Select all
<?php
define('IN_DHG', true);
if(file_exists("install.php")) {
die("Please remove install.php for safety reasons before using this guestbook. Come on, it's better to be safe than sorry.");
}
include("config.php");
$tmp = new template("tmp_header.tpl");
$tmp->replace_tags(array("GUESTBOOK_TITLE" => $gbtitle));
$tmp->output();
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbtable, $conn) or die(mysql_error());
if($newestfirst == "yes") { $ord = "DESC"; } else { $ord = "ASC"; }
$sql = "SELECT * FROM dh_gbentries WHERE trusted = 1 ORDER BY id $ord";
$result = mysql_query($sql, $conn) or die(mysql_error());
if(mysql_num_rows($result) == "0") {
$tmp = new template("tmp_nomsg.tpl");
$tmp->replace_tags(array("LANG_NO_MSG" => $lang_no_msg));
$tmp->output();
}
//notice because of this part
while($g = mysql_fetch_array($result)) {
$g_timeadded = date("jS F Y H:i", $g[timeadded]);
if($allowhtml == "yes") { $g_message = nl2br($g[message]); } else { $g_message = nl2br(htmlspecialchars($g[message])); }
$tmp = new template("tmp_entry.tpl");
$tmp->replace_tags(array("AUTHOR" => $g[author],"DATE_POSTED" => $g_timeadded,"MESSAGE" => $g_message));
$tmp->output();
}
//notice because of above part
$rnad = rand(100000,999999);
$tmp = new template("tmp_postnew.tpl");
$tmp->replace_tags(array("LANG_POST_NEW" => $lang_post_new,"LANG_YOUR_NAME" => $lang_your_name,"LANG_YOUR_MESSAGE" => $lang_your_message,"LANG_TYPE_NUMBER" => $lang_type_number,"LANG_YOUR_IP" => $lang_your_ip,"LANG_ADD_MESSAGE" => $lang_add_message,"IP_ADDR" => $_SERVER['REMOTE_ADDR'],"SECURE_NUMBER" => "$rnad"));
$tmp->output();
?>