<?
include 'protect.php';

?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<div id = "wrapper">

<?
//show categories in dropdown
$sql = $dbh->prepare("select * from topics");
$sql->execute();
while ($carolyn  = $sql->fetch()){
	 echo '<a href = "index.php?topicid='.$carolyn[0].'">'.$carolyn[1].'</a><br/>'."\n";
}

$topicid = $_GET['topicid'];
$picsql = $dbh->prepare("select posttitle, posttext from posts where topicid = '$topicid'");
$picsql->execute();
while ($maruja  = $picsql->fetch()){
$maruja[0].'<br/>'.$maruja[1]."\n";
}


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






?>