public function __construct($site_id = 0) { $this->config = parse_ini_file(__DOCROOT__ . '/config.ini', true); if (!empty($_COOKIE['account_id'])) { $this->account_id = $_COOKIE['account_id']; } $this->site_id = $site_id; eBayListing::$database_connect = mysql_connect($this->config['database']['host'], $this->config['database']['user'], $this->config['database']['password']); eBayListing::$service = $this->config['service']; eBayListing::$exchange_rate = $this->config['exchange_rate']; eBayListing::$install = $this->config['install']; eBayListing::$time_zone = $this->config['time_zone']; eBayListing::$template_status = $this->config['template_status']; if (!eBayListing::$database_connect) { echo "Unable to connect to DB: " . mysql_error(eBayListing::$database_connect); exit; } mysql_query("SET NAMES 'UTF8'", eBayListing::$database_connect); if (!mysql_select_db($this->config['database']['name'], eBayListing::$database_connect)) { echo "Unable to select mydbname: " . mysql_error(eBayListing::$database_connect); exit; } if (isset($_SERVER['HTTP_HOST'])) { //if(strpos($_SERVER['HTTP_HOST'], "shuai64") == false){ //exit; //} } header('Content-Type: text/html; charset=UTF-8'); }