\n");
echo ("What Does Aloha Mean to Us?\n");
echo ("Add your voice to the many who are defining Kaua`i's spirit of aloha through stories and \n");
echo ("personal expressions of what it means to them. \n");
echo ("Please take a few minutes and share your thoughts with others here.\n");
echo (" \n");
// Accept input from Comments Input form
//---------------------Database Connect-----------
// Connect to the database
$db = MYSQL_CONNECT("localhost", "frammit", "snazzle");
MYSQL_SELECT_DB("kauai_aloha",$db);
// Track remote host------------------------------
$host = $REMOTE_ADDR;
// Lookup host name for IP address----------------
$host_name = gethostbyaddr($host);
// Check if Comment was entered - Add Comment to database
if ($add == aloha) {
// Clean up special characters in input-----------
// $name_1 = addslashes($name);
// $email_1 = addslashes($email);
// $url_1 = addslashes($url);
$comment_1 = nl2br($comment);
// $comment_2 = addslashes($comment_1);
// $host_name = gethostbyaddr($host);
// Insert comment
$op1 = "insert into comments (name, email, url, comment, host, host_name) values ('$name', '$email', '$url', '$comment_1', '$host', '$host_name')";
MYSQL_QUERY($op1);
//Flash a Thanks
echo ("\n");
echo ("\n");
}
$add = "";
// Display last 44 comments in reverse order
echo ("Please read thoughts from others about the meaning of aloha: \n");
echo (" ");
$op2 = "select * from comments order by timestamp desc LIMIT 0, 44";
$r2 = MYSQL_QUERY($op2);
while ($entry = MYSQL_FETCH_ARRAY($r2,MYSQL_ASSOC)) {
$mon = substr($entry[timestamp],4,2);
$day = substr($entry[timestamp],6,2);
$yr = substr($entry[timestamp],0,4);
$hr = substr($entry[timestamp],8,2);
$min = substr($entry[timestamp],10,2);
$date_format = "$mon/$day/$yr @ $hr:$min";
echo ("| $entry[comment] | | |
\n");
}
echo (" |