Сообщение от
Doom123
stats.php
PHP код:
<?php
$sqlhost="localhost";
$sqluser="vlada";
$sqlpass="528872";
$db="vlada";
mysql_connect($sqlhost,$sqluser,$qlpass) or die("MySQL не доступен".mysql_error());
mysql_select_db($db);
$res = mysql_query("SELECT COUNT(*) AS membo FROM vlad_members");
$assoc = mysql_fetch_assoc($res);
?>
index.php
PHP код:
<?php
require_once('stat.php');
echo $assoc['stats.php'];
?>
У меня :
stats.php
[QUOTE]
<?php
require 'includes/config.php';
$res = mysql_query("SELECT COUNT(*) AS membo FROM vlad_members");
$assoc = mysql_fetch_assoc($res);
?>
Index.php
<?php
//------------------------------------------------
// Start session and turn off runtime magic quotes
//------------------------------------------------
session_start();
set_magic_quotes_runtime(0);
//------------------------------------------------
// Turn off script execution time limit
//------------------------------------------------
if (function_exists('set_time_limit') == 1 && @ini_get('safe_mode') == 0) @set_time_limit(0);
//------------------------------------------------
// Fetch config file
//------------------------------------------------
require 'includes/config.php';
if (!isset($conf)) exit('The system does not appear to be installed.');
//------------------------------------------------
// Set error reporting to "ALL" if specified in the config file
//------------------------------------------------
if ($conf['debug'] == 2) error_reporting(E_ALL);
//------------------------------------------------
// Define paths
//------------------------------------------------
define ('SYS_PATH', $conf['system_path']);
define ('SYS_PIC_PATH', $conf['system_pic_path']);
define ('SYS_TPL_PATH', $conf['system_tpl_path']);
define ('SYS_LICENSE', $conf['license_number']);
define ('VIR_PATH', $conf['virtual_path']);
define ('VIR_CP_PATH', $conf['virtual_cp_path']);
define ('VIR_PIC_PATH', $conf['virtual_pic_path']);
define ('VIR_TPL_PATH', $conf['virtual_tpl_path']);
define ('DB_PREFIX', $conf['db_prefix']);
define ('TN_PREFIX', $conf['thumbnail_prefix']);
//------------------------------------------------
// Instantiate the Benchmark class
//------------------------------------------------
include SYS_PATH . 'includes/core/core.benchmark.php';
$BM = new Benchmark();
$BM->set_pointer('start_engine');
//------------------------------------------------
// Include functions
//------------------------------------------------
include SYS_PATH . 'includes/fns/fns.misc.php';
//------------------------------------------------
// Instantiate the database class
//------------------------------------------------
include SYS_PATH . 'includes/core/core.mysql.php';
//------------------------------------------------
// Instantiate the cache class
//------------------------------------------------
include SYS_PATH . 'includes/core/core.cache.php';
//------------------------------------------------
// Instantiate the preferences class
//------------------------------------------------
include SYS_PATH . 'includes/core/core.prefs.php';
//------------------------------------------------
// Define time
//------------------------------------------------
define ('SYS_TIME', $PREFS->conf['timezone']);
//------------------------------------------------
// Instantiate the session class
//------------------------------------------------
include SYS_PATH . 'includes/core/core.session.php';
//------------------------------------------------
// Instantiate the template class
//------------------------------------------------
include SYS_PATH . 'includes/core/core.template.php';
$TEMPLATE->ext_dir = 'includes/ext/';
$TEMPLATE->tpl_dir = SYS_TPL_PATH . $PREFS->conf['template'] . '/';
$TEMPLATE->cpl_dir = SYS_TPL_PATH . $PREFS->conf['template'] . '/tmp/';
//------------------------------------------------
// Authenticate user
//------------------------------------------------
if ($SESSION->login() || $SESSION->is_loggedin())
{
//------------------------------------------------
// Set default session
//------------------------------------------------
$TEMPLATE->assign("logged_in", 1);
//------------------------------------------------
// Set default session values
//------------------------------------------------
$SESSION->conf['template'] = $PREFS->conf['override_template'] ? $PREFS->conf['template'] : $SESSION->conf['template'];
$SESSION->conf['language'] = $PREFS->conf['override_language'] ? $PREFS->conf['language'] : $SESSION->conf['language'];
//------------------------------------------------
// Set default template
//------------------------------------------------
$TEMPLATE->assign("template", $SESSION->conf['template']);
//------------------------------------------------
// Reset default template paths
//------------------------------------------------
$TEMPLATE->tpl_dir = SYS_TPL_PATH . $SESSION->conf['template'] . '/'; // templates path
$TEMPLATE->cpl_dir = SYS_TPL_PATH . $SESSION->conf['template'] . '/tmp/'; // compiled templates path
$LANG = array();
if ( isset($_GET['language']) || isset($_SESSION['custlanguage']) ) {
if ( isset($_GET['language']) ) {
$_SESSION['custlanguage'] = $_GET['language'];
}
$SESSION->conf['language'] = $_SESSION['custlanguage'];
$PREFS->conf['language'] = $_SESSION['custlanguage'];
}
//------------------------------------------------
// Set language
//------------------------------------------------
define ('SYS_LANG', $SESSION->conf['language']);
include_once SYS_PATH . 'includes/languages/' . SYS_LANG . '/lang.core.php';
}
else
{
//------------------------------------------------
// Set default session
//------------------------------------------------
$TEMPLATE->assign("logged_in", 0);
//------------------------------------------------
// Set default session values
//------------------------------------------------
$SESSION->conf['member_id'] = 0;
$SESSION->conf['template'] = $PREFS->conf['template'];
$SESSION->conf['language'] = $PREFS->conf['language'];
$SESSION->conf['timezone'] = $PREFS->conf['timezone'];
$SESSION->conf['timeformat'] = $PREFS->conf['timeformat'];
$LANG = array();
if (isset($_GET['language']) || isset($_SESSION['custlanguage']) ) {
if ( isset($_GET['language']) ) {
$_SESSION['custlanguage'] = $_GET['language'];
}
$SESSION->conf['language'] = $_SESSION['custlanguage'];
$PREFS->conf['language'] = $_SESSION['custlanguage'];
}
//------------------------------------------------
// Set default language
//------------------------------------------------
define ('SYS_LANG', $PREFS->conf['language']);
include_once SYS_PATH . 'includes/languages/' . SYS_LANG . '/lang.core.php';
}
//-----------------------------------------------------
// Assign session defaults
//-----------------------------------------------------
$TEMPLATE->set_session_defaults();
//------------------------------------------------
// Include functions selector
//------------------------------------------------
include SYS_PATH . 'includes/lib.php';
//-----------------------------------------------------
// Display global message
//-----------------------------------------------------
$TEMPLATE->output_message();
//-----------------------------------------------------
// Output our template
//-----------------------------------------------------
$BM->set_pointer('start_template');
$template = $TEMPLATE->result();
$BM->set_pointer('end_template');
header('Content-Type: text/html; charset=utf-8');
echo $template;
$BM->set_pointer('end_engine');
require_once('stats.php');
echo $assoc['stats.php'];
//------------------------------------------------------------
// Disconnect from the database
//------------------------------------------------------------
$DB->disconnect_db();
?>
Ничего не выводит!
Что делать?