| Server IP : 103.48.194.25 / Your IP : 216.73.217.33 Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33 System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64 User : sieuthimay ( 1016) PHP Version : 8.2.20 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/zomuaban.com/public_html/ |
Upload File : |
<?php
define('sitename', "Đăng tin mua bán rao vặt - ZoMuaBan.com");
define('domain', "http://".$_SERVER['HTTP_HOST']."/");
define('site', domain);
define('url', domain);
define('skin', domain."skin/");
define('urlimg', domain."uploads/");
function trit($o='123',$num=1)
{
echo '<pre>'; print_r($o) ;
if($num) die();
}
//trit(substr($_SERVER['HTTP_HOST'], 0, 4));
# Nếu có www > redirect qua trang ko có www
if (substr($_SERVER['HTTP_HOST'], 0, 4) === 'www.') {
header('Location: http'.(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on'?'s':'').'://'.substr($_SERVER['HTTP_HOST'],4).$_SERVER['REQUEST_URI']);
exit;
}
# DOMAIN : Xác định domain, subdomain mỗi site
define( 'DOMAIN', $_SERVER['HTTP_HOST'] == 'localhost'
|| $_SERVER['HTTP_HOST'] == 'zomuaban.com'
|| $_SERVER['HTTP_HOST'] == '103.48.194.25'
? 'zomuaban.com' : $_SERVER['HTTP_HOST']
);
//trit(DOMAIN);
$SEGMENTS = explode ('.', DOMAIN);
# THEME : Xác định thư mục config mỗi site
# > pegaad.dev/au
# > alogap.dev / au
if(count($SEGMENTS) == 2) {
define('SITEMAIN', $SEGMENTS[0] .'.'. $SEGMENTS[1]); //pagead.dev
define('THEME', SITEMAIN.'/www'); //pagead.dev/www
}else if (count($SEGMENTS) == 3) {
define('SITEMAIN', $SEGMENTS[1] .'.'. $SEGMENTS[2]);
define('THEME', SITEMAIN.'/'.$SEGMENTS[0]);
# Nếu domain không hợp lệ > chuyển hướng sang trang chính
$SUB['pegaad'] = array('zomuaban','com' , 'au', 'ca', 'hk', 'fr', 'gb', 'in', 'ng', 'nz', 'ph', 'sg', 'us', 'uk','za');
/*$SUB['halload']= ['halload', 'com' , 'au', 'ca', 'hk', 'fr', 'gb', 'in', 'ng', 'nz', 'ph', 'sg', 'us', 'uk', 'za' ];*/
/*$SUB['alogap'] = ['alogap', 'com'];*/
# Nếu là trang gb -> chuyển về uk
if ($SEGMENTS[0]=='gb') {
header('Location: http://uk.'.$SEGMENTS[1].'.com'); die();
}
# Nếu không phải là sub - domain trong list trên > chuyển hướng về domain chính
else if(!in_array($SEGMENTS[0], $SUB[$SEGMENTS[1]])) {
header('Location: http://'.$SEGMENTS[1].'.com'); die();
}
}else{
# Nếu bằng 4 > không hợp lệ > chuyển hết về trang chính
header('Location: http://'.$SEGMENTS[2].'.com');
die();
}
# DEBUG : Xác định chế độ debug mode
if($SEGMENTS[0] == 'dev'){
define('DEBUG', true);
error_reporting(E_ALL);
ini_set('display_errors','on');
}else{
define('DEBUG', true);
}
//trit: get database name
define('DB_NAME', $SEGMENTS[0].'_'.$SEGMENTS[1]) ; //trit(DB_NAME);
//$db_name = explode ('.',DOMAIN)[1].'.'.explode ('.',DOMAIN)[0];
# Thư mục chứa hình ảnh, css, js ... của ứng dụng
define('PUBLIC_PATH', 'public/frontend/');
/*
*---------------------------------------------------------------
* SYSTEM FOLDER NAME
*---------------------------------------------------------------
*
* This variable must contain the name of your "system" folder.
* Include the path if the folder is not in the same directory
* as this file.
*
*/
$system_path = '../../system';
$application_folder = 'site';
// Set the current directory correctly for CLI requests
if (defined('STDIN'))
{
chdir(dirname(__FILE__));
}
if (realpath($system_path) !== FALSE)
{
$system_path = realpath($system_path).'/';
}
// ensure there's a trailing slash
$system_path = rtrim($system_path, '/').'/';
// Is the system path correct?
if ( ! is_dir($system_path))
{
exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME));
}
/*
* -------------------------------------------------------------------
* Now that we know the path, set the main path constants
* -------------------------------------------------------------------
*/
// The name of THIS file
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
// The PHP file extension
// this global constant is deprecated.
define('EXT', '.php');
// Path to the system folder
define('BASEPATH', str_replace("\\", "/", $system_path));
// Path to the front controller (this file)
define('FCPATH', str_replace(SELF, '', __FILE__));
// Name of the "system folder"
define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
// The path to the "application" folder
if (is_dir($application_folder))
{
define('APPPATH', $application_folder.'/');
}
else
{
if ( ! is_dir(BASEPATH.$application_folder.'/'))
{
exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
}
define('APPPATH', BASEPATH.$application_folder.'/');
}
/*
* --------------------------------------------------------------------
* LOAD THE BOOTSTRAP FILE
* --------------------------------------------------------------------
*
* And away we go...
*
*/
require_once BASEPATH.'core/CodeIgniter.php';
/* End of file index.php */
/* Location: ./index.php */