<?php
Defined (' ACC ') | | Exit (' Access Denied ');
Initialization scripts, specifically responsible for environment detection and configuration
0: First detect where you are
/*
Under Win, the path
D:\www\info no problem.
D:/www/info no problem.
On the Linux path
/var/www/info, forward slash
So: Unify into forward slash, in Linux format
*/
Detecting the root directory and defining constants
Define (' ROOT ', str_replace (' include/init.php ', ' ', str_replace (' \ \ ', '/', __file__)));
Contains the public underlying file
Require (ROOT. ' include/absdb.class.php ');
Require (ROOT. ' include/mysql.class.php ');
Require (ROOT. ' include/conf.class.php ');
Require (ROOT. ' include/log.class.php ');
Require (ROOT. '/model/model.php ');
function __autoload ($classname) {
Require (ROOT. ' model/'. $classname. '. php ');
}
Detect magic quotes with or without opening, if not turned on, the Get,post,cookie manually escaped. (addslashes)
if (!GET_MAGIC_QUOTES_GPC ()) {
function Addslash ($arr) {
foreach ($arr as $k = = $v) {
if (Is_array ($v)) {
$arr [$k] = Addslash ($v);
} else if (is_string ($v)) {
$arr [$k] = addslashes ($v);
}
}
return $arr;
}
$_get = Addslash ($_get);
$_post = Addslash ($_post);
$_cookie = Addslash ($_cookie);
}