【php开源代码栏目提醒】:网学会员为广大网友收集整理了,admin.php,希望对大家有所帮助!
<?php
//初始化session
session_start();
// 包含数据库连接文件和头文件
require ('dbconnect.php');
include('head.php');
?>
<?
// 必须是管理员登录后,才能管理,如果管理员没有登录,直接退出
// $_SESSION['Adm'] 不能用$Adm变量代替
if(!isset($_SESSION['Adm'])) {
echo "<p align=center>";
echo "<font color=#FF0000 size=5><strong><big>";
echo "管理员还没有登录,请<a href='login.php'>登录</a>!";
echo "</big></strong></font></p>";
exit();
}
// 构造读取数据的sql语句
$sql="select * from member";
$result=my
sql_query($sql,$conn);
// 显示投票主题
?>
<table width="100%" border="1" cellspacing="1" cellpadding="3">
<tr>
<th colspan="7">所有
会员浏览</th>
</tr>
<tr>
<th width="10%">用户名</th>
<th width="15%">真实</th>
<th width="5%">性别</th>
<th width="20%">Email</th>
<th width="20%">注册时间</th>
<th width="15%">
注册ip</th>
<th width="15%">修改/删除</th>
</tr>
<?
while($title=
mysql_fetch_array($result)){
echo "<tr> ";
echo "<td width='10%' align=center><a href='userinfo.php?id=$title[id]'>$title[id]</a></td>";
echo "<td width='15%' align=center>$title[name]</td>";
echo "<td width='5%' align=center>$title[sex]</td>";
echo "<td width='20%' align=center>$title[email]</td>";
echo "<td width='20%' align=center>$title[regtime]</td>";
echo "<td width='15%' align=center>$title[regip]</td>";
echo "<td width='15%' align=center><a href='adminmodify.php?id=$title[id]'>修改</a><br><a href='delete.php?id=$title[id]'>删除</a></td>";
echo "</tr>";
}
echo "</table>";
echo "<a href='logout.php'>管理员注销登录</a>";
?>