Location: PHPKode > projects > ArticleSetup > ArticleSetup-v1-1/upload/page.php
<?php 
include('config.php');

	//Create site settings variables			
	$sitequery = 'select * from settings;';
	$siteresult = mysql_query($sitequery,$connection) or die(mysql_error());
	$siteinfo = mysql_fetch_array($siteresult);
	$siteurl = $siteinfo['url'];
	
	$page = $_GET['p'];

      if (!is_numeric($page)) {
              header('Location: '.$siteurl); 
         }
        
        else

        {   
	
	$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'];
	$title = stripslashes($info['title']);
	$body = stripslashes($info['body']);


// Meta info
	$metatitle = $title." - ";
	$cathead = 0;


	include('header.php'); 

	include('sidebar.php'); 

// Checks if article exists
	$num_results = mysql_num_rows($results);
	if ($num_results == 0) { 
		echo "<br/><p><b>This article doesn't exist!</b></p>";
	}
	
	
// Setup the template
	$page = new Template("templates/".$template."/page.tpl");
	$page->set("title", $title );
	$page->set("body", $body);
	
	
// Outputs the page template!
	echo $page->output();


include('rightsidebar.php');


include('obinclude.php'); 

}


?>
Return current item: ArticleSetup