【php开源代码栏目提醒】:网学会员php开源代码为您提供admin_pass.php参考,解决您在admin_pass.php学习中工作中的难题,参考学习。
<?php require_once('Connections/connNetForum.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE passadmin SET passwd=%s , usrname=%s",
GetSQLValueString($_POST['passwd'], "text"),
GetSQLValueString($_POST['usrname'], "text"));
mysql_select_db($database_connNetForum, $connNetForum);
$Result1 = mysql_query($updateSQL, $connNetForum) or die(mysql_error());
$updateGoTo = "admin.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
mysql_select_db($database_connNetForum, $connNetForum);
$query_RecAdmin = "SELECT * FROM passadmin";
$RecAdmin = mysql_query($query_RecAdmin, $connNetForum) or die(mysql_error());
$row_RecAdmin = mysql_fetch_assoc($RecAdmin);
$totalRows_RecAdmin = mysql_num_rows($RecAdmin);
?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>更改管理密码</title>
<style type="text/css">
<!--
.underline {border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 1px;
border-left-width: 0px;
border-top-style: dashed;
border-right-style: dashed;
border-bottom-style: dashed;
border-left-style: dashed;
border-top-color: #666666;
border-right-color: #666666;
border-bottom-color: #666666;
border-left-color: #666666;
}
-->
</style>
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle"><table width="450" height="150" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="170" valign="top"><img src="images/admin_pass-03_r1_c1.gif" width="170" height="150" /></td>
<td valign="bottom"><form action="<?php echo $editFormAction; ?>" method="POST" id="form1" name="form1">
<table width="100%" height="150" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="bottom"><table width="92%" height="120" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="22%" height="30" align="right">账号:</td>
<td width="4%" height="30"> </td>
<td width="74%" height="30" align="left"><font face="Arial, Helvetica, sans-serif">
<input name="usrname" type="text" class="underline" id="usrname" value="<?php echo $row_RecAdmin['usrname']; ?>" />
</font></td>
</tr>
<tr>
<td height="30" align="right">密码:</td>
<td height="30"> </td>
<td height="30" align="left"><font face="Arial, Helvetica, sans-serif">
<input name="passwd" type="password" class="underline" id="passwd" value="<?php echo $row_RecAdmin['passwd']; ?>" />
</font></td>
</tr>
<tr>
<td height="48" colspan="3" align="center"><table width="70%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right"><a href="javascript:form1.submit();"><img src="images/007.gif" width="90" height="24" border="0"></a></td>
<td> </td>
<td><a href="javascript:window.history.back();"><img src="images/006.gif" width="90" height="24" border="0"></a></td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
<input type="hidden" name="MM_update" value="form1">
</form> </td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($RecAdmin);
?>
上一篇:
admin_ok.php
下一篇:
基于web二手汽车交易管理系统(含录像)