Help! Newbiew can't get a return from database

I just posted this in the Database thread, then I found this forum:

Hello-I am brand new at this and I am reading the book “Build Your Own Database Driven Website…” by Kevin Yank 4th ed.

I don’t know if this is the right place to get help - if it isn’t can someone please point me in the right direction

Okay - question: I am in chapter 4 and have done the exercise to inserting data into the database. I did the exercise fine, but when I try to place into my own template it works up to the submit. When I hit submit the page comes back blank. I have my template showing but not the updated list.

I noticed a few things in the URL:
In the example from the book, page one the URL read: …addjoke/
page two reads: addjoke/?addjoke
page three reads: addjoke/

Now I know it is returning to the index page. In my page which is part of a website the URL reads such:
page one:…mod_10.2/term.php
page two:…mod_10.2/term.php?addjoke (I am using the same database just using my template)
page three:…mod_10.2/term.php?

So I am guessing it is returning to the controller page which is term.php but can’t find the updates?

I used the same code in the book, but only added my html for my template to the term.php or controller page. Any ideas why this will not return correctly?

Thanks so much for any help

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>

&lt;div id="container"&gt;

&lt;div id="brand"&gt;&lt;a href="index.php"&gt;&lt;img src="images/logo.jpg" alt="logo"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div id = "top_menu"&gt;&lt;/div&gt;

&lt;?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

?&gt;



&lt;div id="content1"&gt;&lt;h1&gt;TERMINOLOGIES&lt;/h1&gt;&lt;/div&gt;

&lt;div id="leftside"&gt;&lt;strong&gt;Fine Art&lt;/strong&gt;&lt;br /&gt;
&lt;img src="images/paint.jpg" alt="painting"/&gt;
&lt;h3&gt;&lt;i&gt;Dictionary.com:&lt;/i&gt; 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.&lt;/h3&gt;
&lt;/div&gt;
&lt;div id="content2"&gt;

&lt;?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>