Here is the code to the index or term page to the question above. Maybe this will help someone help me with my problem?
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml” xml:lang=“en” lang=“en”>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1” />
<title>Artworks: Terminoloiges</title>
<link rel = “stylesheet” href = “main_styles.css” />
</head>
<body>
<div id="container">
<div id="brand"><a href="index.php"><img src="images/logo.jpg" alt="logo"/></a></div>
<div id = "top_menu"></div>
<?php
include_once (“includes/top_menu.inc”); // sets $top_menu variable
include_once (“includes/foot.inc”); // sets $top_menu variable
include_once (“main_template.inc”); //include the main template, has all the variables
?>
<div id="content1"><h1>TERMINOLOGIES</h1></div>
<div id="leftside"><strong>Fine Art</strong><br />
<img src="images/paint.jpg" alt="painting"/>
<h3><i>Dictionary.com:</i> a visual art considered to have been
created primarily for aesthetic purposes and judged for its beauty and meaningfulness,
specifically, painting, sculpture, drawing, watercolor, graphics, and architecture.</h3>
</div>
<div id="content2">
<?php
if (get_magic_quotes_gpc())
{
function stripslashes_deep($value)
{
$value = is_array($value) ?
array_map(‘stripslashes_deep’, $value) :
stripslashes($value);
return $value;
}
$_POST = array_map('stripslashes_deep', $_POST);
$_GET = array_map('stripslashes_deep', $_GET);
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
$_REQUEST = array_map('stripslashes_deep', $_REQUEST);
}
if (isset($_GET[‘addterm’]))
{
include ‘form.html.php’;
exit();
}
$link = mysqli_connect(‘localhost’, ‘root’, ‘root’);
if (!$link)
{
$error = ‘Unable to connect to the database server.’;
include ‘error.html.php’;
exit();
}
if (!mysqli_set_charset($link, ‘utf8’))
{
$output = ‘Unable to set database connection encoding.’;
include ‘output.html.php’;
exit();
}
if (!mysqli_select_db($link, ‘itdb’))
{
$error = ‘Unable to locate the term database.’;
include ‘error.html.php’;
exit();
}
if (isset($_POST[‘termtext’]))
{
$termtext = mysqli_real_escape_string($link, $_POST[‘termtext’]);
$sql = ‘INSERT INTO term SET
termtext="’ . $termtext . ‘",
termdate=CURDATE()’;
if (!mysqli_query($link, $sql))
{
$error = 'Error adding submitted term: ’ . mysqli_error($link);
include ‘error.html.php’;
exit();
}
header('Location:term.php');
exit();
}
$result = mysqli_query($link, ‘SELECT termtext FROM term’);
if (!$result)
{
$error = 'Error fetching terms: ’ . mysqli_error($link);
include ‘error.html.php’;
exit();
}
while ($row = mysqli_fetch_array($result))
{
$terms = $row[‘termtext’];
}
include ‘terms.html.php’;
?>
</div>
</div>
</body>
</html>