Location: PHPKode > projects > Horizon Blogging Software > post.php
<?php
$time_start = microtime(TRUE);

define('IN_HBS',TRUE);

include('inc/include.php');
$cfg = getConfig();

$vars['config'] = $cfg;
$vars['title'] = $cfg['hzn_title'];
show_page('header',$vars,$cfg['template']);
db();

if($_GET['id'] == '' || !isset($_GET['id'])) 
{
	$vars['error'] = "Invalid ID specified";
}
else
{
	$id = (int)$_GET['id'];

	$sql = "SELECT * FROM " . $mysql["db_prefix"] . "main WHERE `id` = $id LIMIT 1;";

	$vars = array('show_install' => FALSE , 'error' => "Horizon Blogging Software could'nt connect to the main MySQL table. Please make sure settings in inc/cfg.php are correct. If you cannot fix the problem, please go to the Edge Drive Community by clicking <a href='http://www.edgedrive.com/community'>here</a>. Once there, be sure to include the error which is stated below.", 'sql_error' => $sql . "<br />" . mysql_error());
	$result = mysql_query($sql) or die(show_page('error',$vars,$cfg['template']));
	$vars = null;
	if (mysql_num_rows($result) == 1)
	{
		$row = mysql_fetch_row($result);
	
		$date = date("l F d Y", $row['1']);
	
		$title = stripslashes($row['2']);
		$entry = stripslashes($row['3']);
		$id = stripslashes($row['0']);

		$vars['title'] = $title;
		$vars['id'] = $id;
		$vars['category'] = $category;
		$vars['entry'] = $entry;
		$vars['num_rows'] = $num_rows;
		$vars['date'] = $date;
	}
	else
	{
		$vars['error'] = "Invalid ID specified";
	}
}
show_page('post',$vars,$cfg['template']);

$vars['version'] = getVersion();
show_page('footer',$vars,$cfg['template']);
$time_end = microtime(TRUE);
$time = $time_end - $time_start;
echo $time;
?>
Return current item: Horizon Blogging Software