📄 begin.php
字号:
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
if (!get_magic_quotes_gpc()) {
$_POST = quotes($_POST);
$_GET = quotes($_GET);
$_FILES = quotes($_FILES);
$_COOKIE["adminname"] = addslashes($_COOKIE["adminname"]);
$_COOKIE["adminpw"] = addslashes($_COOKIE["adminpw"]);
}
$myconn = mysql_pconnect($servername, $dbusername, $dbpass)or die(mysql_error());
mysql_select_db($dbname, $myconn) or die(mysql_error());
@mysql_query("SET NAMES 'utf8'");
function adminlogin()
{
global $db_prefix, $myconn, $username, $password, $time, $usergroupid;
if (!empty($_COOKIE["adminname"]) && !empty($_COOKIE["adminpw"])) {
$result = mysql_query("select * from {$db_prefix}groupuser where username='$_COOKIE[adminname]' && groupid in('1','2')", $myconn);
$row = mysql_fetch_array($result);
if ($row['password'] == $_COOKIE['adminpw']) {
$username = $_COOKIE["adminname"];
$password = $_COOKIE["adminpw"];
$usergroupid = $row["groupid"];
setcookie("adminname", $username, 1800 + time());
setcookie("adminpw", $password, 1800 + time());
} else {
header("Location: login.php");
exit;
}
} else {
header("Location: login.php");
exit;
}
}
function echoerror($number)
{
global $reuser;
include"language/message.php";
unset($ioymessage);
require_once "./template/return.htm";
exit;
}
function echoioy($number)
{
global $reurl, $reuser;
include"language/message.php";
unset($errormessage);
require_once "./template/return.htm";
exit;
}
function stime()
{
global $serverdiff;
return time() + ($serverdiff * 60);
}
function nameformat($val)
{
$val = str_replace("\\", '', $val);
$val = str_replace("'", '', $val);
$val = str_replace('"', '', $val);
$val = str_replace(' ', '', $val);
$val = str_replace('<', '', $val);
$val = str_replace('>', '', $val);
$val = str_replace('&', '', $val);
$val = str_replace("\t", '', $val);
$val = str_replace("\r", '', $val);
$val = str_replace("\n", '', $val);
return $val;
}
function jsformat($val)
{
$val = str_replace("\\", "\\\\", $val);
$val = str_replace("'", "\'", $val);
$val = str_replace("\n", '', $val);
$val = str_replace("\r", '', $val);
return $val;
}
function min_format($a, $b)
{
if (is_numeric($a)) {
$a = $a < $b?$b:$a;
} else {
$a = $b;
}
return $a;
}
function max_format($a, $b)
{
if (is_numeric($a)) {
$a = $a > $b?$b:$a;
} else {
$a = $b;
}
return $a;
}
function quotes($string)
{
if (is_array($string)) {
foreach($string as $key => $val) {
$string[$key] = quotes($val);
}
} else {
$string = addslashes($string);
}
return $string;
}
function jyname($str)
{
for($i = 0;isset($str[$i]);$i++) {
$bin = decbin(ord($str[$i]));
if ($bin > '10000000') {
for($n = 1;$bin[$n];$n++, $i++);
} else {
$ord = ord($str[$i]);
if (!(($ord > 47 && $ord < 58) || $ord == ord('_') || ($ord > 96 && $ord < 123))) return true;
}
}
return false;
}
/*function lmenu($j, $id, $name, $url = '###')
{
global $first, $h;
if ($first) $firstchild = 'first-child ';
if ($j == 1) {
$java=$url!='###'?$url:'javascript:void(0)';
$txt = '<li class="' . $firstchild . '"><a href="'.$java.'" class="\'.$lmenut[' . $id . '].\'" onclick="DoMenu(\\\'ChildMenu' . $id . '\\\')">' . $name . '</a>';
} else if ($j == 2) {
$txt = '<li><a class="' . $firstchild . '\'.$lmenuf[' . $id . '].\'" href="' . $url . '">' . $name . '</a></li>';
} else if ($j == 3) {
$txt = '<li><a class="sun \'.$lmenuf[' . $id . '].\'" href="' . $url . '">' . $name . '</a></li>';
}
$first = false;
return $txt;
} */
$time = stime();
$reuser = null;
$reurl = null;
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -