|
|
|
ช่วยด้วย!!!! ไม่รู้ ว่า error ที่อะไรค่ะ พอกำหนดสิทธิ์การเข้าใช้ ตามรูปค่ะ ส่วนCode ทั้งหมด อยู่ด้านล่าง |
|
|
|
|
|
|
|
Code (PHP)
<?php require_once('Connections/condb.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
session_start();
}
// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
$_SESSION['MM_Username'] = NULL;
$_SESSION['MM_UserGroup'] = NULL;
$_SESSION['PrevUrl'] = NULL;
unset($_SESSION['MM_Username']);
unset($_SESSION['MM_UserGroup']);
unset($_SESSION['PrevUrl']);
$logoutGoTo = "index.php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
}
}
?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "1,2";
$MM_donotCheckaccess = "false";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "login.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
$MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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;
}
}
$colname_showmember = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_showmember = $_SESSION['MM_Username'];
}
mysql_select_db($database_condb, $condb);
$query_showmember = sprintf("SELECT * FROM tb_member WHERE m_username = %s", GetSQLValueString($colname_showmember, "text"));
$showmember = mysql_query($query_showmember, $condb) or die(mysql_error());
$row_showmember = mysql_fetch_assoc($showmember);
$totalRows_showmember = mysql_num_rows($showmember);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title> SiteMap </title>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery-3.2.0.min"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min"></script>
<style type="text/css">
img{
padding:10px;
}
</style>
<!-- Start bar -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<style type="text/css">
.dropdown:hover .dropdown-menu {
display: block;
margin-top: 0;
}
</style>
</script>
</head>
<body background="img/aerial-view-1210063_1920.jpg">
<div class="container">
<br>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-2">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">SiteMap</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-2">
<ul class="nav navbar-nav">
<?php
$level = $row_showmember['m_level'];
if($level==1){ ?>
<li ><a href="superadmin.php">Home <span class="sr-only">(current)</span></a></li>
<li ><a href="edit admin.php">จัดการข้อมูลผู้ดูแล <span class="sr-only">(current)</span></a></li>
<li><a href="Register.php">เพิ่มข้อมูลสมาชิก <span class="sr-only">(current)</span></a></li>
}
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> <?php echo $row_showmember['m_name']; ?> <b class="caret">
</b></a>
<ul class="dropdown-menu">
<li><a href="<?php echo $logoutAction ?>">ออกจากระบบ</a></a></li>
</ul>
</li>
</ul>
</div>
<?php
mymysql_free_result($showmember);
?>
[/font]
</div>
</nav>
<!-- /.end manu -->
<!--Start map-->
<!--endmap-->
</body>
</html>
Tag : PHP, MySQL, HTML, Appserv
|
ประวัติการแก้ไข 2017-05-12 14:13:44
|
|
|
|
|
Date :
2017-05-12 14:11:44 |
By :
toeylove |
View :
832 |
Reply :
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Error อะไรตรงไหนครับ
|
|
|
|
|
Date :
2017-05-12 18:02:04 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error ว่าไง ครับ บรรทัด 172 ใน โค้ด edit admin.php มีค่าว่าง ด้วยอะครับบ ที่จริง น่าจะแบบนี้นะครับ edit_admin.php
|
|
|
|
|
Date :
2017-05-13 16:40:50 |
By :
tamiiz01jr |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
มี Error Message หรือเปล่าครับ
|
|
|
|
|
Date :
2017-05-15 09:26:06 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175-176 ไม่มีแทกปิด
166-167 HTML ผสม php
|
ประวัติการแก้ไข 2017-05-15 14:52:55
|
|
|
|
Date :
2017-05-15 14:49:48 |
By :
Chaidhanan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|