Database structure: (Library name: LYB)
Table One: admin
Field: ID (int11) name (VARCHVR) password (VARCHVR)
Table II: LO
Fields: IDs (int11) Username (VARCHVR) Sex (VARCHVR) QQ (VARCHVR) Email (VARCHVR) info (text) IP (VARCHVR) submit_time (datetime)
1, conn.php (Connection database file)
<?php
mysql_connect("localhost","root","");//连接数据库
mysql_select_db("lyb");//选择数据库
?>
2, header.php (Common header file)
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Silver Message Board Version 1.0</title>
<link href= "Css.css" rel= "stylesheet" type= "Text/css"/>
<body>
<div id= "Head" >
<div id= "head_l" >
<ul>
<li><a href= "index.php" > I want to see message </a></li>
<li><a href= "post.php" > I want to publish </a></li>
<?php
Session_Start ();
if ($_session["key"]==1) {//if the obtained session is 1 then the admin item is displayed
?>
<li><a href= "adminexit.php" > Exit management </a></li>
?
}
Else
{
?>
<li><a href= "admin.php" > I want to manage </a></li>
?? >
</ul>
</div>
<div id= "Head_r" > Silver message Board Version 1.0</div>
</div>
3, footer.php (Common bottom file)
<?php
$counterFile="conter.xml";
function displayCounter($counterFile){
$fp = fopen($counterFile,"rw");
$num = fgets($fp,5);
$num += 1;
print "<div id=\"footer\">银子留言板 Version 1.0 您是第 "."$num"." 位无聊的银</div>";
exec("rm -rf $counterFile");
exec("echo $num > $counterFile");
}
if(!file_exists($counterFile)){
exec("echo 0 > $counterFile");
}
displayCounter($counterFile);
?>
</body>