<?
include '/home/mmaaaco/public_html/wdm3304materials/wdm3304week11/connect.php';
//include '/home/mmaaaco/public_html/wdm3304materials/wdm3304week10/membership/protect.php';
//must protect & connect.php

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div style = "width:800px">
<?
include 'search.php';

$sql = $dbh->prepare("select topicid,topicname from 3304_topics order by dateposted desc");
$sql->execute();
?>
<form action = "posts.php" method="get">
<select name = "topicid">
<?
while ($row = $sql->fetch())
{
$topicid = $row['topicid'];
$topicname = $row['topicname']; 
echo '<option value="'.$topicid.'">'.$topicname.'</option>';	
}
?>
</select>
<input type = "submit" name="submit" value = "Go to topic"/>
</form>
<?
//add search functionality
//display topics with topicid as a link or dropdown...we need a method for the user to select the latest topics!


?>
</div>
<div>

</div>
</body>
</html>
