1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
<?php
//new pdo if (!headers_sent()) { header('X-UA-Compatible: IE=8,chrome=1'); }
//$dbh = new PDO("mysql:host=localhost;dbname=eizocomcn", "kelvin", "kelvin123123"); $dbh = new PDO("mysql:host=192.168.155.13;dbname=eizo", "admin", "PHac7dru"); $dbh->exec("set names utf8");
date_default_timezone_set("Asia/Hong_Kong");
if (!function_exists('random_string')) { function random_string( $length = 8 ) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $random_string = substr( str_shuffle( $chars ), 0, $length ); return $random_string; } }
if (session_id() === "") { session_start(); }
error_reporting(E_ALL); ini_set('display_errors', 1);
if(!isset($_SESSION["langcode"])){ $_SESSION["langcode"] = "tc"; }
$sql0 = "SELECT * FROM site_info WHERE siteinfoid = '1' "; $sth0 = $dbh->prepare($sql0); $sth0->execute(); if (!$sth0->execute()) throw new Exception('[' . $sth0->errorCode() . ']: ' . $sth0->errorInfo()); $row0 = $sth0->fetch(PDO::FETCH_ASSOC);
$sql00 = "SELECT * FROM sys_lang WHERE langstatus = '1' ORDER BY langsort ASC "; $sth00 = $dbh->prepare($sql00); if (!$sth00->execute()) throw new Exception('[' . $sth00->errorCode() . ']: ' . $sth00->errorInfo()); while ($row00 = $sth00->fetch(PDO::FETCH_ASSOC)) { $arraylangcode[$row00{'langcode'}] = $row00{'langname'}; }
?>
|