表一: 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(连接数据库文件)
复制代码 代码如下:
mysql_connect("localhost","root","");//连接数据库 mysql_select_db("lyb");//选择数据库 ?>
2、header.php(公用头部文件)
复制代码 代码如下:
nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
银子留言板 Version 1.0 偶要看留言 偶要发表 session_start(); if($_SESSION["key"]==1){//如果获取的SESSION为1则显示管理项 ?> 退出管理 } else { ?> 偶要管理 }?> 银子留言板 Version 1.0
3、footer.php(公用底部文件)
复制代码 代码如下:
$counterFile="conter.xml"; function displayCounter($counterFile){ $fp = fopen($counterFile,"rw"); $num = fgets($fp,5); $num += 1; print "
银子留言板 Version 1.0 您是第 "."$num"." 位无聊的银
";
exec("rm -rf $counterFile");
exec("echo $num > $counterFile");
}
if(!file_exists($counterFile)){
exec("echo 0 > $counterFile");
}
displayCounter($counterFile);
?>
Statement: The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn