css教程如何修改留言板程序
error_reporting(0);
$conn = new com("adodb.connection");
$conn->open("driver={microsoft access driver (*.mdb)}; dbq=" . realpath("db.mdb "));
$rs=new com("adodb.recordset");
$abc = $_get["abc"]; $webn = $_post["webn"]; $name = $_post["name"]; $pws = $_post["pws"]; $newpws = $_post["newpws"];
$rs->open("select * from [web]",$conn,1,1);
$adminname = $rs->fields(1)->value;
$adminpws = $rs->fields(2)->value;
$ll = $rs->fields(3)->value;
$webname = $rs->fields(4)->value;
$rs->close();
$admincookie = $adminname;
$conn->execute("update [web] set [ll] = '$ll'+1"); //$rs->close();
?>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.111cn.net/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title><? echo $webname ?></title>
<style type="text/css教程">
<!--
body {font-size:14px; line-height:25px; margin:10px auto; padding:10px; width:680px; border:solid #8aa 1px;}
a {color:#008; text-decoration:none;}
a:hover {color:#f00; text-decoration:underline;}
hr {color:#8aa; height:1px;}
-->
</style>
</head>
<body>
<?
if ($abc=="admin"){
if ($name==$adminname && $pws==$adminpws){
setcookie("admin", $admincookie, time()+3600); header("location:./");
}else{echo "<script>alert('用户名或密码错误!');history.back();</script>";}
}
if ($abc=="exit"){
setcookie("admin", "", time()-3600); header("location:./");
}
if ($abc=="editadmin"){
if (!$webname || !$name || !$pws){
echo "<script>alert('留言本、用户名、原密码不能为空!');history.back();</script>";
}
if ($pws!=$adminpws){
echo "<script>alert('愿密码错误!');history.back();</script>";
}
if($newpws!=""){
$conn->execute("update [web] set [webname] = '$webname' , [name] = '$name' , [pws] = '$newpws'");
$conn->close(); //$conn=null;
echo "<script>alert('修改成功,请重新登录!');location='?abc=exit';</script>";
}else{
$conn->execute("update [web] set [webname] = '$webn' , [name] = '$name'");
$conn->close(); //$conn=null;
echo "<script>alert('修改成功!');location='./';</script>";
}
}
?>
<b>【 <a href="./"><? echo $webname ?></a> 】</b>
<a href="">管理</a> <? if (isset($_cookie["admin"])){ ?> <a href="">修改资料</a> <a href="">安全退出</a><? ;} ?>
<? if ($abc=="user" && !isset($_cookie["admin"])){ ?>
<form method="post" action="">
用户名:<input name="name" type="text" value=""/>
密码:<input name="pws" type="password" value=""/>
<input name="add" type="submit" value="确定" />
</form>
<? ;} ?>
<? if ($abc=="edituser"){ ?>
<form method="post" action="">
留言本:<input name="webn" type="text" value="<? echo $webname; ?>" size="80"/>
<br />
用户名:<input name="name" type="text" value="<? echo $admincookie; ?>"/>
原密码:<input name="pws" type="password" value=""/>
新密码:<input name="newpws" type="password" value=""/>
<input name="add" type="submit" value="确定" />
</form>
<? ;} ?>
<hr/>
<?
$id=$_get['id'];
$sj=date('y-m-d');
if($abc=="add"){
$nr=$_post['nr'];
$ip=getenv("remote_addr");
if (!$nr){
echo "<script>alert('留言不能为空!');history.back();</script>";
}else{
$conn->execute("insert into [txt] (nr,sj) values ('$nr','$sj')");
}
echo "<script>alert('操作成功!');location='./';</script>";
$conn->close(); $conn=null;
}
if($abc=="del"){
$conn->execute("delete from [txt] where [id]=".$id);
$conn->close(); $conn=null; header("location:./");
}
if($abc=="edit"){
$nr=$_post['nr'];
$hf=$_post['hf'];
$conn->execute("update [txt] set [nr] = '$nr' , [hf] = '$hf' where [id]=".$id);
$conn->close(); $conn=null; header("location:./");
}
$zd=$_get['zd'];
if($zd!=""){
if($zd=="0")$zd=1; else $zd=0;
$conn->execute("update [txt] set [zd] = '$zd' where [id]=".$id);
$conn->close(); $conn=null; header("location:./");
}
?>
<center>
<form method="post" action="">
<textarea name="nr" cols="88" rows="8" style="line-height:25px;"></textarea><br /><br />
<input name="add" type="submit" value="发表留言" />
</form>
</center>
<hr/>
<?
//分页
$rs->open("select * from [txt] order by [zd] desc, [sj] desc",$conn,1,3);
$rs->pagesize=5;
$page=trim($_get['page']);
if($page=="" || is_numeric(intval($page))<=0){$page=1;}else if(intval($page)>$rs->pagecount){$page=$rs->pagecount;}
$page=intval($page);
if(!$rs->eof||$rs->bof){
$rs->absolutepage=$page; $mypagesize=$rs->pagesize; $i=$rs->recordcount()-($page-1)*$rs->pagesize;
while(!$rs->eof && $mypagesize>0 && $i>=$rs->recordcount()-1-$rs->pagesize*$page){
$id = $rs->fields(0)->value;
$nr = $rs->fields(1)->value;
$hf = $rs->fields(2)->value;
$sj = $rs->fields(3)->value;
$zd = $rs->fields(4)->value;
?>
<div style="border:#eee solid 1px; background:#f8f8f8; padding:0 10px;">
<div style="float:left;">
<? if ($zd!=0) echo "【 <font color='#008800'>置顶</font> 】2881064151"; else echo "id.".$i; ?>
<? if ($_cookie["admin"]==$admincookie){ ?>
操作:<a href=''><? if ($zd==0) echo "置顶"; else echo "取消置顶"; ?></a> |
<a href=''>修改/回复</a> |
<a href=''>删除</a>
<? ;} ?>
</div>
<div style="float:right;">
date:<? echo $sj; ?>
</div>
<div style="clear:both"></div>
</div>
<hr/>
<? if ($abc=="hf" && $id==$_get['id']){ ?>
<form method="post" action="" id="<? echo $id ?>">
留言:<textarea name="nr" cols="80" rows="8" style="line-height:25px;"><? echo $nr; ?></textarea><br />
回复:<textarea name="hf" cols="80" rows="8" style="line-height:25px;"><? echo $hf; ?></textarea><br />
操作:<input name="add" type="submit" value="回复/修改" />
</form>
<? ;} ?>
<div style="margin:20px;">
<?
$nr = str_replace("n","n".'<br/>',$nr);
$nr = str_replace(" ",' ',$nr);
echo $nr."<br />";
?>
<?
if ($hf!=""){
echo "<font color='#aa0000'>回复:";
$hf = str_replace("n","n".'<br/>',$hf);
$hf = str_replace(" ",' ',$hf);
echo $hf."</font>";
}
?>
</div>
<hr/>
<? $rs->movenext; $mypagesize--; $i--; } } //分页循环 ?>
<center>
留言数(<? echo $rs->recordcount(); ?>)
<a href="">首页</a>
<a href="">上页</a>
第<? echo $page;?>/<? echo $rs->pagecount;?>页
<a href="">下页</a>
<a href="">尾页</a>
访问量(<? echo $ll ?>)
</center>
<? $rs->close(); $rs=null; $conn->close(); $conn=null; ?>
</body>
</html>
css教程如何修改留言板程序的更多相关文章
- php留言板程序
=================== 先创建note.php <html><head><title>PHP留言本</title></head&g ...
- [课程设计]Scrum 3.7 多鱼点餐系统开发进度(留言板选择方案)
Scrum 3.7 多鱼点餐系统开发进度(留言板选择方案) 1.团队名称:重案组 2.团队目标:长期经营,积累客户充分准备,伺机而行 3.团队口号:矢志不渝,追求完美 4.团队选题:餐厅到店点餐系统W ...
- 留言板0.4_model中的数据库(2)
今天就讲讲:如何将后台数据呈现在HTML页面中,以及url配置时的两点技巧吧. 1.首先在"views.py"中提取出后台数据 def getform(request): mess ...
- python完成留言板功能
<!DOCTYPE html> <html lang="zh"> <head> <meta charset="utf-8&quo ...
- flask实战-留言板-Web程序开发流程
Web程序开发流程 在实际的开发中,一个Web程序的开发过程要设计多个角色,比如客户(提出需求).项目经理(决定需求的实现方式).开发者(实现需求)等,在这里我们假设自己是一个人全职开发.一般来说一个 ...
- 【weiphp微信开发教程】留言板插件开发详解
基于weiphp框架的留言板插件教程: 1.功能分析 传统的留言板应该具有发布留言.查看留言.回复留言.管理留言等功能,本教程开发的是最基本的留言板,仅包含发布留言和查看留言两个功能,根据功能用boo ...
- 微信小程序实现简易留言板
微信小程序现在很火,于是也就玩玩,做了一个简易的留言板,让大家看看,你们会说no picture you say a j8 a,好吧先上图. 样子就是的,功能一目了然,下面我们就贴实现的代码,首先是H ...
- Operator 示例:使用 Redis 部署 PHP 留言板应用程序
「Kubernetes 官方示例:使用 Redis 部署 PHP 留言板应用程序」Operator 化. 源码仓库:https://github.com/jxlwqq/guestbook-operat ...
- 利用反馈字段给帝国cms添加留言板功能(图文教程)
帝国cms的插件中提供信息反馈字段,很多人却不会用.这里谢寒教大家如何来给自己的帝国cms网站添加留言板功能 1.找到添加地址 2.添加字段 3.你可以在字段中添加多种字段类型(有文本域,单行文本框, ...
随机推荐
- iOS 和Android中的正则表达式简单使用
ios 中需要使用NSRegularExpression类,NSTextCheckingResult类. 下面给出最基本的实现代码 NSRegularExpression *regex = [NSRe ...
- Java for LeetCode 060 Permutation Sequence
The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the p ...
- 【回溯】n皇后问题
问题 U: [回溯]n皇后问题 时间限制: 1 Sec 内存限制: 128 MB提交: 4 解决: 4[提交][状态][讨论版] 题目描述 在一个国际象棋棋盘上,放置n个皇后(n<10),使 ...
- 中石油-高精度除法-java版
问题 G: [高精度]高精度数除以低精度数I 时间限制: 1 Sec 内存限制: 512 MB提交: 19 解决: 15[提交][状态][讨论版] 题目描述 修罗王聚集了庞大的暗元素以施展隐匿魔法 ...
- 如何为Linux生成和打上patch
通过diff工具生成补丁, patch工具打上补丁. 在使用diff之前, 你需要保留一份未修改过的源码, 然后在其它地方修改源码的一份拷贝. diff对比这两份源码生成patch. 修改过的源码必须 ...
- java写入文件的几种方法分享
转自:http://www.jb51.net/article/47062.htm 一,FileWritter写入文件 FileWritter, 字符流写入字符到文件.默认情况下,它会使用新的内容取代所 ...
- Word2013对公式处理:样式、自动编号、交叉引用
因快写毕业论文,专门研究了一下Word2013对公式的处理,有一点小心得,记在这里. 文章中公式展示的预期效果是:公式居中,尾端有编号,同时在文章中可以实现引用.实现该效果有很多方法,这里就说一种,其 ...
- C/C++知识点
1 cout<<endl;什么意思? 就是回车的意思~ 相当于C语言里面的printf("\n"); 2 cin>> 键盘输入 例子:double r=1 ...
- 【Android】SlidingMenu属性详解(转)
原文:http://my.eoe.cn/1169143/archive/21892.html SlidingMenu简介:SlidingMenu的是一种比较新的设置界面或配置界面效果,在主界面左滑或者 ...
- Mysql 对数字的格式化
format函数: 格式化浮点数 format(number, length); Formats the number X to a format like '#,###,###.##', r ...