【php开源代码栏目提醒】:网学会员,鉴于大家对php开源代码十分关注,论文会员在此为大家搜集整理了“admin_detail.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 forummain SET main_subject=%s, main_content=%s WHERE main_id=%s",
GetSQLValueString($_POST['main_subject'], "text"),
GetSQLValueString($_POST['main_content'], "text"),
GetSQLValueString($_POST['main_id'], "int"));
mysql_select_db($database_connNetForum, $connNetForum);
$Result1 = mysql_query($updateSQL, $connNetForum) or die(mysql_error());
$updateGoTo = "admin_detail.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form2")) {
$updateSQL = sprintf("UPDATE forumre SET re_subject=%s, re_content=%s WHERE re_id=%s",
GetSQLValueString($_POST['re_subject'], "text"),
GetSQLValueString($_POST['re_content'], "text"),
GetSQLValueString($_POST['re_id'], "int"));
mysql_select_db($database_connNetForum, $connNetForum);
$Result1 = mysql_query($updateSQL, $connNetForum) or die(mysql_error());
$updateGoTo = "admin_detail.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
$colname_RecMain = "-1";
if (isset($_GET['main_id'])) {
$colname_RecMain = (get_magic_quotes_gpc()) ? $_GET['main_id'] : addslashes($_GET['main_id']);
}
mysql_select_db($database_connNetForum, $connNetForum);
$query_RecMain = sprintf("SELECT *, CONCAT(main_sex, main_face) as faceImg FROM forummain WHERE main_id = %s", GetSQLValueString($colname_RecMain, "int"));
$RecMain = my
sql_query($query_RecMain, $connNetForum) or die(mysql_error());
$row_RecMain = mysql_fetch_assoc($RecMain);
$totalRows_RecMain = mysql_num_rows($RecMain);
$colname_RecRe = "-1";
if (isset($_GET['main_id'])) {
$colname_RecRe = (get_magic_quotes_gpc()) ? $_GET['main_id'] : addslashes($_GET['main_id']);
}
mysql_select_db($database_connNetForum, $connNetForum);
$query_RecRe = sprintf("SELECT *,CONCAT(re_sex, re_face) as faceImg FROM forumre WHERE main_id = %s ORDER BY re_time DESC", GetSQLValueString($colname_RecRe, "int"));
$RecRe = mysql_query($query_RecRe, $connNetForum) or die(mysql_error());
$row_RecRe = mysql_fetch_assoc($RecRe);
$totalRows_RecRe = mysql_num_rows($RecRe);
?><!DOCTYPE html PUBLIC "-//W3C//DTD X
HTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>互动讨论区 -
程序管理</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/
JavaScript">
<!--
function centerWindow(theURL,winName,width,height,features) {
//织梦平台 http://www.e-dreamer.idv.tw
//分享是成长的开始
var window_width = width;
var window_height = height;
var edfeatures= features;
var window_top = (screen.height-window_height)/2;
var window_left = (screen.width-window_width)/2;
newWindow=window.open('