📄 header.php
字号:
<?
// SCRiPTMAFiA 2005
include "mysqlcon.php";
$n = basename($_SERVER['PHP_SELF']);
$admin_info = mysql_fetch_assoc(mysql_query("SELECT * FROM bhost_admin"));
include "functions.php";
// HIDE ERROR IF DEBUG MODE IS OFF
if($admin_info[debug] == 0) {
error_reporting(0);
} else {
error_reporting(E_ALL ^ E_NOTICE);
}
// SET HTML HEADER
$head = "
$admin_info[html_header]
<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td valign='top'>
";
// SET HTML FOOTER
$foot = "
</td></tr></table>
$admin_info[html_footer]
";
// SET HOMEPAGE
if($admin_info[homepage] == "") { $homepage = "login.php"; } else { $homepage = $admin_info[homepage]; }
if($n != "login.php" & $n != "signup.php" & $n != "forgot.php" & $n != "verify.php" & $n != "tip.php" & $n != "example.php" & $n != "interests.php") {
if($n == "profile.php") {
if(isset($_POST['u'])) { $u = $_POST['u']; } elseif(isset($_GET['u'])) { $u = $_GET['u']; } else { $u = ""; }
$q = mysql_query("SELECT * FROM bhost_users WHERE username='$u'");
if(mysql_num_rows($q) == 0 & $u != "") { exit(); }
$user_info = @mysql_fetch_assoc($q);
} else {
if(isset($_POST['u'])) { $u = $_POST['u']; } elseif(isset($_GET['u'])) { $u = $_GET['u']; } else { header("Location: $homepage"); exit(); }
$q = mysql_query("SELECT * FROM bhost_users WHERE username='$u'");
if(mysql_num_rows($q) == 0) { exit(); }
$user_info = mysql_fetch_assoc($q);
}
// SET GROUP INFO
$group_info = mysql_fetch_assoc(mysql_query("SELECT * FROM bhost_groups WHERE g_id='$user_info[g_id]'"));
// CHECK IF USER BANNED IP ADDRESS
$banned_ips = $user_info['banned_ips'];
if($banned_ips != "") {
$myip = $_SERVER['REMOTE_ADDR'];
$banned_ip = explode(",", $banned_ips);
$total = count($banned_ip);
for($c=0;$c<$total;$c++) {
$banned = str_replace("*", "[0-9]{1,3}", $banned_ip[$c]);
$banned = str_replace(".", "\.", $banned);
if(preg_match("/\b$banned\b/", $myip)) {
echo $head;
echo "$header15";
echo $foot;
exit();
}
}
}
$is_admin_logged_in = "no";
$is_logged_in = "no";
if(isset($_COOKIE['admin_username']) & isset($_COOKIE['admin_password'])) {
if(stripslashes($_COOKIE['admin_username']) != encrypt($admin_info[username]) | stripslashes($_COOKIE['admin_password']) != encrypt($admin_info[password])) {
$is_logged_in = "no";
} else {
$is_logged_in = "yes";
$is_admin_logged_in = "yes";
$member_info[username] = "<b>Administrator</b>";
$member_info[u_id] = 0;
}
} elseif(isset($_COOKIE['username']) & isset($_COOKIE['password']) & isset($_COOKIE['u_id'])) {
$u_id = u_decrypt($_COOKIE['u_id']);
$member_info = mysql_fetch_assoc(mysql_query("SELECT * FROM bhost_users WHERE u_id='$u_id'"));
if(stripslashes($_COOKIE['username']) == u_encrypt($member_info[username]) & stripslashes($_COOKIE['password']) == cookie_encrypt(decrypt($member_info[password]), $member_info[code])) {
$is_logged_in = "yes";
} else {
$is_logged_in = "no";
}
} else {
$is_logged_in = "no";
}
}
// INCLUDE LANGUAGE FILE
if($is_logged_in == "no" | $is_admin_logged_in == "yes") {
include "./lang/$admin_info[language]";
} else {
$member_group_info = mysql_fetch_assoc(mysql_query("SELECT * FROM bhost_groups WHERE g_id='$member_info[g_id]'"));
if($member_group_info[allow_language] == "1" & $member_info[language] != "" & file_exists("./lang/$member_info[language]")) {
include "./lang/$member_info[language]";
} else {
include "./lang/$admin_info[language]";
}
}
// CHECK IF IP ADDRESS IS BANNED
$banned_ips = $admin_info['banned_ips_access'];
if($banned_ips != "") {
$myip = $_SERVER['REMOTE_ADDR'];
$banned_ip = explode(",", $banned_ips);
$total = count($banned_ip);
for($c=0;$c<$total;$c++) {
$banned = str_replace("*", "[0-9]{1,3}", $banned_ip[$c]);
$banned = str_replace(".", "\.", $banned);
if(preg_match("/\b$banned\b/", $myip)) {
echo $head;
echo "$header15";
echo $foot;
exit();
}
}
}
// CHECK IF WEBLOG IS DISABLED
if($u != "" AND $user_info[enabled] == 0 AND $user_info[u_id] != "") {
echo "
$admin_info[html_header]
$header18
<br><br>
<form action='login.php' method='POST'>
<input type='submit' class='button' value='$header19'>
</form>
$admin_info[html_footer]
";
exit();
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -