留言板.docx
- 文档编号:4273417
- 上传时间:2023-05-06
- 格式:DOCX
- 页数:11
- 大小:17.91KB
留言板.docx
《留言板.docx》由会员分享,可在线阅读,更多相关《留言板.docx(11页珍藏版)》请在冰点文库上搜索。
留言板
数据库结构:
(库名:
lyb)
表一:
admin
字段:
id(int11) name(varchvr) password(varchvr)
表二:
lo
字段:
id(int11) username(varchvr) sex(varchvr) qq(varchvr) email(varchvr) info(text) ip(varchvr) submit_time(datetime)
1、conn.php(连接数据库文件)
php
mysql_connect("localhost","root","");//连接数据库
mysql_select_db("lyb");//选择数据库
?
>
2、header.php(公用头部文件)
DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http:
//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
//www.w3.org/1999/xhtml">
偶要看留言 偶要发表 退出管理 偶要管理
php
session_start();
if($_SESSION["key"]==1){//如果获取的SESSION为1则显示管理项
?
>
}
else
{
?
>
}?
>
3、footer.php(公用底部文件)
php
$counterFile="conter.xml";
functiondisplayCounter($counterFile){
$fp = fopen($counterFile,"rw");
$num= fgets($fp,5);
$num+=1;
print"
exec("rm-rf$counterFile");
exec("echo$num>$counterFile");
}
if(!
file_exists($counterFile)){
exec("echo0>$counterFile");
}
displayCounter($counterFile);
?
>