Location: PHPKode > projects > Nitrotech > nitrotech/pages.php
<?php

//
//start everything needed
//
$root = './';
$page_name = 'Pages';
$page_file = basename(__FILE__);

include($root . "includes/common.php");

$page_mode = (isset($_GET['mode'])) ? $_GET['mode'] : '';
$page_id = (isset($_GET['page_id'])) ? $_GET['page_id'] : '';

//
//Start the page
//

//dbstart();  //start databse     --- already started
$query1 = "SELECT * FROM " . $table['pages'] . " WHERE id='". $page_id ."'";
$result1 = mysql_query($query1);
if (!$result1)
{
   message("Could not successfully run query ($query1) from DB: " . mysql_error(), 'die');
}
@$id1 = mysql_result($result1,0,"id");

    if (!$id1)
    {
        message("No such page.", 'message');
    }

$name1 = mysql_result($result1,0,"page_name");
$text1 = mysql_result($result1,0,"page_text");
$auth1 = mysql_result($result1,0,"auth");
$loggedin1 = mysql_result($result1,0,"logged_in");
$text1 = text_read($text1);

$page_name = $name1;
//
//Start the output of the page
//

page_header('normal');

if($loggedin1 == '2')
{
	$logged = '0';
}

//check auth
if(($auth1 - 1) < get_userinfo('level') && ($loggedin1 == '0' || $loggedin1 == loggedin() || $logged == loggedin()))
{
	echo($text1);
}
else
{
	message("You are not authorised to view this page, or an error has occured. It could be that ?id is not set in the URL", 'message');
}

page_footer('normal');

unset($query1);
unset($result1);
unset($id1);
unset($name1);
unset($auth1);
unset($text1);

//
//End the page
//

dbend(); //end the database

?>
Return current item: Nitrotech