Table One: admin
Field: ID (int11) name (VARCHVR) password (VARCHVR)
Table II: LO
Field: ID (int11) Username (VARCHVR) Sex (VARCHVR) QQ (VARCHVR) Email (VARCHVR) info (text) IP (VARCHVR) submit_time (datetim E
1, conn.php (Connection database file)
Copy Code code as follows:
<?php
mysql_connect ("localhost", "root", "");/Connection Database
mysql_select_db ("Lyb");//Select Database
?>
2, header.php (Common header file)
Copy Code code as follows:
<! 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)
Copy Code code as follows:
<?php
$counterFile = "Conter.xml";
function Displaycounter ($counterFile) {
$fp = fopen ($counterFile, "RW");
$num = Fgets ($fp, 5);
$num + 1;
Print "<div id=\" footer\ "> Silver Message Board Version 1.0 You are the first". " $num "." A bit of a dull silver </div> ";
EXEC ("Rm-rf $counterFile");
EXEC ("echo $num > $counterFile");
}
if (!file_exists ($counterFile)) {
EXEC ("Echo 0 > $counterFile");
}
Displaycounter ($counterFile);
?>
</body>
Current 1/4 page
1234 Next read the full text