Viewing file: index.php (2.11 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php require_once "infosys_global.php"; $TOOLS_PATH = $GLOBALS["_SYSDIR_PATH"][8] . "tools/"; $TOOLS_URL = $GLOBALS["_INFOADDIN_URL"] . "tools/"; $WORKING_PATH = $GLOBALS["_SYSDIR_PATH"][8] . "announce/"; $IMGTYPE = array(0 => "???", 1 => "gif", 2 => "jpg", 3 => "png", 4 => "swf", 5 => "psd", 6 => "bmp", 7 => "tiff", 8 => "tiff", 9 => "jpc", 10 => "jp2", 11 => "jpx", 12 => "jb2", 13 => "swc", 14 => "iff", 15 => "wbmp", 16 => "xbm");
$errmsg = "<br><br>\n"; $errmsg .= "<table align=\"center\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"red\">"; $errmsg .= "<tr bgcolor=\"#ff9999\"><th align=\"left\">%s</th></tr>"; $errmsg .= "<tr bgcolor=\"#ffffff\"><td style=\"padding: 15px 20px 15px 20px\"><span>%s</span></td></tr>"; $errmsg .= "</table>\n"; $mysql_port = "3306"; $link = mysql_connect($GLOBALS["DBHOST"] . ":" . $mysql_port, $GLOBALS["DBUSER_INFOAI"], $GLOBALS["DBPASS_INFOAI"]); if ($link) { $db = $GLOBALS["DBNAME_INFOAI"]; mysql_query("set names 'tis620'"); mysql_select_db($dbname); if (!mysql_select_db($db, $link)) { echo sprintf($errmsg, "แจ้งการดำเนินการ", mysql_errno($link) . ": " . mysql_error($link)); } $currdate = date("Y-m-d"); } else { echo sprintf($errmsg, "แจ้งการดำเนินการ", "ติดต่อฐานข้อมูลไม่ได้หรือชื่อฐานข้อมูลไม่มีในระบบ"); } if ($link) mysql_close($link);
function &bind_content ($pairs, &$content) { $patterns = array(); $replace = array(); $i = 0; if ($pairs != NULL && $content != NULL) { foreach ($pairs as $key => $value) { $patterns[$i] = "/(\s*?){($key)}(\s*?)/"; $replace[$i++] = "\${1}$value\${3}"; } $content = preg_replace($patterns, $replace, $content); } return $content; }
function read_template ($path_name) { $text = ""; if (is_file($path_name)) $text = implode("", @file($path_name)); return $text; } ?>
|