📄 get_admin.php
字号:
</td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#C6C3C6">
<td align="center" height="20">
<img src="<?php echo $img_loc; ?>/h_line.gif" height="18" width="490">
</td>
</tr>
<tr bgcolor="#C6C3C6">
<td align="right"><img src="<?php echo $img_loc; ?>/disabled.gif" width="75" height="22" border="0" alt="Back"><input type="image" src="<?php echo $img_loc; ?>/next.gif" width="75" height="22" border="0" alt="Next">
<img src="<?php echo $img_loc; ?>/cancel.gif" width="75" height="22" usemap="#Cancel" border="0" alt="Cancel"><map name="Cancel"><area shape="rect" coords="1,1,73,20" href="javascript:abort()"></map>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<br>
</body>
</html>
<?php
}
function new_admin() {
global $PHP_SELF, $version, $img_loc;
global $dbName, $sql_hostname, $sql_username, $sql_password;
?>
<body bgcolor="#3A6EA5" onload="set_focus()">
<br>
<br>
<table border="1" cellspacing="0" cellpadding="0" align="center" width="500">
<tr bgcolor="#C6C3C6">
<td>
<table width="500" border="0" cellspacing="0" cellpadding="1" align="center">
<tr bgcolor="#400080">
<td height="20" class="td1" bgcolor="#000084"><b><font color="#FFFFFF">
Advanced Poll <?php echo $version; ?></font></b></td>
<td height="20" class="td1" align="right" bgcolor="#000084"><img src="<?php echo $img_loc; ?>/cross.gif" width="16" height="14" border="0" usemap="#close"><map name="close"><area shape="rect" coords="1,1,14,12" href="javascript:abort()"></map>
</td>
</tr>
<tr align="center">
<td colspan="2">
<form method="post" action="<?php echo $PHP_SELF; ?>" name="FormPwd" onsubmit="return check_data()">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr bgcolor="#FFFFFF" valign="bottom">
<td class="td1" height="30"><b> Connection
established</b></td>
</tr>
<tr bgcolor="#FFFFFF">
<td class="td1" height="30">
<?php echo "$sql_username"."@"."$sql_hostname"; ?></td>
</tr>
<tr bgcolor="#C6C3C6">
<td class="td1" align="center">
<table width="400" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="td1" height="75">Please enter a new
username and password for the admin control panel.</td>
</tr>
<tr>
<td height="140" class="td1">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="18%" class="td1">Username:</td>
<td width="82%">
<input type="text" name="username" size="25">
</td>
</tr>
<tr>
<td width="18%" class="td1">Password:</td>
<td width="82%">
<input type="password" name="password" size="25">
</td>
</tr>
<tr>
<td width="18%" class="td1">Confirm:</td>
<td width="82%">
<input type="password" name="confirm" size="25">
<input type="hidden" name="dbName" value="<?php echo $dbName; ?>">
<input type="hidden" name="sql_hostname" value="<?php echo $sql_hostname; ?>">
<input type="hidden" name="sql_username" value="<?php echo $sql_username; ?>">
<input type="hidden" name="sql_password" value="<?php echo $sql_password; ?>">
<input type="hidden" name="action" value="account">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#C6C3C6">
<td align="center" height="20">
<img src="<?php echo $img_loc; ?>/h_line.gif" height="18" width="490">
</td>
</tr>
<tr bgcolor="#C6C3C6">
<td align="right"><img src="<?php echo $img_loc; ?>/disabled.gif" width="75" height="22" border="0" alt="Back"><input type="image" src="<?php echo $img_loc; ?>/next.gif" width="75" height="22" border="0" alt="Next">
<img src="<?php echo $img_loc; ?>/cancel.gif" width="75" height="22" usemap="#Cancel" border="0" alt="Cancel"><map name="Cancel"><area shape="rect" coords="1,1,73,20" href="javascript:abort()"></map>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<br>
</body>
</html>
<?php
}
function message_box($msg) {
global $version, $img_loc;
?>
<body bgcolor="#3A6EA5">
<br><br><br><br><br><br>
<table border="1" cellspacing="0" cellpadding="0" align="center" width="300">
<tr bgcolor="#C6C3C6">
<td>
<table width="300" border="0" cellspacing="0" cellpadding="1" align="center">
<tr bgcolor="#400080">
<td height="20" class="td1" bgcolor="#000084"><b><font color="#FFFFFF">
Advanced Poll <?php echo $version; ?></font></b></td>
<td height="20" class="td1" align="right" bgcolor="#000084"><img src="<?php echo $img_loc; ?>/cross.gif" width="16" height="14" border="0">
</td>
</tr>
<tr align="center">
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr bgcolor="#C6C3C6">
<td align="center" height="75" width="20%"><img src="<?php echo $img_loc; ?>/info.gif" width="35" height="35"></td>
<td align="left" height="75" width="80%" class="td1"><?php echo $msg; ?></td>
</tr>
<tr bgcolor="#C6C3C6" align="center">
<td colspan="2" height="40"><img src="<?php echo $img_loc; ?>/disabled.gif" width="75" height="22" border="0" alt="Back"> <img src="<?php echo $img_loc; ?>/ok.gif" width="75" height="22" border="0" alt="Ok"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<br>
</body>
</html>
<?php
}
if (!isset($action)) {
$action ='';
}
if (file_exists("../include/config.inc.php")) {
include "../include/config.inc.php";
include "../include/$POLLDB[class]";
} elseif (file_exists("./include/config.inc.php")) {
include "./include/config.inc.php";
include "./include/$POLLDB[class]";
} else {
message_box("Cannot find configuration file");
exit;
}
switch ($action) {
case "cancel":
print_header();
message_box("The operation has been cancelled!");
break;
case "connect":
print_header();
$POLLDB["dbName"] = $dbName;
$POLLDB["host"] = $sql_hostname;
$POLLDB["user"] = $sql_username;
$POLLDB["pass"] = $sql_password;
$poll_db = new polldb_sql();
$poll_db->connect();
new_admin();
break;
case "account":
print_header();
srand((double)microtime()*1000000);
$session = md5 (uniqid (rand()));
if (get_magic_quotes_gpc()) {
$password = stripslashes($password);
}
$password = md5($password);
$POLLDB["dbName"] = $dbName;
$POLLDB["host"] = $sql_hostname;
$POLLDB["user"] = $sql_username;
$POLLDB["pass"] = $sql_password;
$poll_db = new polldb_sql();
$poll_db->connect();
$sql_query = "UPDATE ".$POLLTBL["poll_user"]." SET username='$username', userpass='$password', session='$session' WHERE user_id='1'";
$poll_db->query($sql_query);
message_box("The username and password have been changed!");
break;
default:
print_header();
db_config();
break;
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -