Location: PHPKode > projects > SQL Familytree > core.php
<?php

//////////////////////////////////////////////////////////////////////
//
// $Id: core.php,v 1.6 2002/02/05 21:57:19 carney Exp $
//
// Copyright (C) 2002 Michael Carney
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
//////////////////////////////////////////////////////////////////////

function redirect($url) 
{
    header("Location: $url"); 
    exit; 
}

if (file_exists("dbvars.php") == false)
{
    redirect("setup.php?reason=new_site");
}    
include_once("dbvars.php");

// First connect up to the database
$dbid = @mysql_connect($dbhost, $dbuname, $dbpass);
if (!$dbid)
{
    redirect("setup.php?reason=bad_db");
}

if (!mysql_select_db("$dbname"))
    redirect("setup.php?reason=bad_name");

global $active_userid;
include_once ("util/session.php");
include_once ("class/session.php");
session_start();
if (!session_register("active_userid"))
{
    echo "ooops, cant register session variable";
    exit;
}

$s  = new Session($active_userid); 

include_once ("class/page.php");
include_once ("class/theme.php");
include_once ("util/dbutils.php");

$p = new Page();
$t = new Theme();

if ($auto_form_action == "submit_form")
{
    include ("util/autoform.php");
    submitForm();
}
?>
Return current item: SQL Familytree