<?php 
include('config.php');
	
	$page = $_GET['p'];
	
	$query = "select * from pages where id = ".$page;
	$results = mysql_query($query,$connection) or die(mysql_error());
	$info = mysql_fetch_array($results);
	
//Get article info	
	$id = $info['id'];
	$authorid = $authorinfo['authorid'];
	$title = stripslashes($info['title']);
	$body = stripslashes($info['body']);


//Meta info
$metatitle = $title." - ";
$cathead = 0;
include('header.php'); 

include('sidebar.php'); 

$num_results = mysql_num_rows($results);
if ($num_results == 0) { // Checks if article exists
	echo "<br/><p><b>This article doesn't exist!</b></p>";
	}
	
	
?>

<!-- CONTENT AREA -->
<div id="content">	


	<h1><?php echo $title; ?></h1>
	
<div id="content-body">

<?php echo $body; ?>

	
</div>
</div>

<?php include('rightsidebar.php'); ?>
<div class="clear"></div>



<?php include('footer.php'); ?>
