<?php
//此原程序粗糙,经BUC团队优化后成为现在的版本。
//共优化项目:1.HTML代码标准化。2.布局更正。3.发表留言成功后手动点击查看改为自动。
//4.增加了session.php,使留言成功后继续留言不用重复输入Name。5.去除无用代码。
//6.将写入数据库模块和读取数据库模块整合。7.表情JS程序分离。8.表单对敏感字符进行过滤。
//9.使用header("location:");来完成写入数据库成功后跳转,实现“无刷新”。
//Time: 5:04 2009-2-11
//http://www.1931-09-18.com
?>
<?php
include "session.php";
//config
$datafile=file("data_textdb.php");
$tfile = 'data_textdb.php';
$cel1="#616c7a";
$cel2="#56606d";
$entrate=10;
//*config
$azz=$_GET['pagina'];
$inizio=$_GET['pagina']*$entrate;
$fine=$inizio+$entrate;
$s=sizeof($datafile);
if ($_GET['pagina'] == "") { $i=0; }
if ($_GET['pagina'] != "") { $i=$inizio; }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>CB</title>
<script language="javascript" src="../scripts/CB/CB_chat-book.js"></script>
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
}
body,td,th {
font-size: 12px;
color: #E6E9EC;
}
input.login {
font-family:Arial,Helv,sans-serif;
font-size:11px;
color: #FF0000;
background: transparent;
border: 1px solid #000000;
font-weight: bold;
}
a:link {
color: #0000FF;
}
a:visited {
color: #CCCCCC;
}
-->
</style>
</head>
<body>
<table width="100%" border="1" align="center" bgcolor="#8995A3">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" bgcolor="#000000">
<tr>
<td>
<?php
//写入数据库
if ($_GET['name'] == "") { echo "<font color=\"#FF0000\"><b>现在不能发布数据,还没有输入\"Name\"。</b></font>"; }
if ($_GET['mess'] == "") { echo "<br /><font color=\"#FF0000\"><b>现在不能发布数据,还没有输入\"Message\"。 <a href=\"../_down/down_angel.php\">CB程序源代码可到../_down下载</a></b></font>"; }
if (($_GET['name'] != "") && ($_GET['mess'] != "")) {
$a=$_GET['name'];
$b=$_GET['mess'];
$bb = ereg_replace("\n","",$b);
$stringData = "$a|$b\n";
$replaced = ereg_replace("<[^>]*>","",$stringData);
$tfile = 'data_textdb.php';
if (file_exists($tfile)) {
$file = file($tfile);
$fp = fopen("$tfile", "w+");
fwrite($fp,$replaced);
if (is_array($file)) {
while (list(, $line) = each($file)) {
fwrite($fp, $line);
}
}
}
fclose($fp);
header("location:_index.php?name=$session_var1_name&pagina=0");
}
//*写入数据库
?>
</td>
</tr>
</table>
<table width="100%" border="0">
<?php
//读取数据库
while (($i <= $fine) && (explode("|",$datafile[$i]) != null)) {
$mop = explode("|",$datafile[$i]);
$number = $i;
$newtext = wordwrap($mop[0], 10, "\n", 1); //这里是读取Name数据字节量
$newtext1 = wordwrap($mop[1], 80, "\n", 1);//这里是读取Message数据字节量
$newtext1 = str_replace("/n","", $newtext1);
$newtext1 = str_replace(":lol:","<img src=\"smiles/icon_lol.gif\" />", $newtext1);
$newtext1 = str_replace(":-?","<img src=\"smiles/icon_confused.gif\" />", $newtext1);
$newtext1 = str_replace(":oops:","<img src=\"smiles/icon_redface.gif\" />", $newtext1);
$newtext1 = str_replace(":shock:","<img src=\"smiles/icon_eek.gif\" />", $newtext1);
$newtext1 = str_replace(":-x","<img src=\"smiles/icon_mad.gif\" />", $newtext1);
$newtext1 = str_replace(":roll:","<img src=\"smiles/icon_rolleyes.gif\" />", $newtext1);
$newtext1 = str_replace(";-)","<img src=\"smiles/icon_wink.gif\" />", $newtext1);
$newtext1 = str_replace(":idea:","<img src=\"smiles/icon_idea.gif\" />", $newtext1);
$newtext1 = str_replace(":!:","<img src=\"smiles/icon_exclaim.gif\" />", $newtext1);
$newtext1 = str_replace(":-P","<img src=\"smiles/icon_razz.gif\" />", $newtext1);
$newtext1 = str_replace(":-D","<img src=\"smiles/icon_biggrin.gif\" />", $newtext1);
$newtext1 = str_replace(":-)","<img src=\"smiles/icon_smile.gif\" />", $newtext1);
$newtext1 = str_replace(":-/","<img src=\"smiles/icon_neutral.gif\" />", $newtext1);
$newtext1 = str_replace(":-(","<img src=\"smiles/icon_sad.gif\" />", $newtext1);
$newtext1 = str_replace(":cry:","<img src=\"smiles/icon_cry.gif\" />", $newtext1);
$newtext1 = str_replace("8-)","<img src=\"smiles/icon_cool.gif\" />", $newtext1);
$newtext1 = str_replace(":-o","<img src=\"smiles/icon_surprised.gif\" />", $newtext1);
$newtext1 = str_replace(":?:","<img src=\"smiles/icon_question.gif\" />", $newtext1);
$newtext1 = stripslashes($newtext1);
if($number & 1) {
echo "<tr><td bgcolor=\"$cel1\"><b>$newtext </b>-- $newtext1 </td></tr>";
}
else {
echo "<tr><td bgcolor=\"$cel2\"><b>$newtext </b>-- $newtext1 </td></tr>";
}
$i++;
}
//*读取数据库
?>
</table>
<form name="post" action="_index.php" method="get">
<table border="0" align="center">
<tr>
<td width="62"><div align="left"><b>Name:</b></div></td>
<td width="63">
<input
onclick="javascript:this.value='';" size="15"
value="<?php echo $session_var1_name; ?>" name="name" maxlength="5">
</td>
</tr>
<tr>
<td width="62"><div align="left"><b>Message:</b></div></td>
<td width="63">
<input
id=message onkeyup=storeCaret_post(this);
onclick=storeCaret_post(this);
onselect=storeCaret_post(this); name="mess" size="15" maxlength="40">
</td>
</tr>
</table>
<table border="1" cellspacing="0" bordercolor="#666666" align="center">
<tr>
<td>
<img title=" :lol:" style="CURSOR: pointer"
onclick="javascript:emoticon_post(':lol:')" height="15"
alt=" :lol:"
src="smiles/icon_lol.gif" width="15"
border="0">
</td>
<td>
<img title=" :-?" style="CURSOR: pointer"
onclick="javascript:emoticon_post(':-?')" height="15" alt=" :-?"
src="smiles/icon_confused.gif"
width="15" border="0">
</td>
<td>
<img title=" :oops:" style="CURSOR: pointer"
onclick="javascript:emoticon_post(':oops:')" height="15"
alt=" :oops:"
src="smiles/icon_redface.gif"
width="15" border="0">
</td>
<td>
<img title=" :shock:" style="CURSOR: pointer"
onclick="javascript:emoticon_post(':shock:')" height="15"
alt=" :shock:"
src="smiles/icon_eek.gif" width="15"
border="0">
</td>
<td>
<img title=" :-x" style="CURSOR: pointer"
onclick="javascript:emoticon_post(':-x')" height="15" alt=" :-x"
src="smiles/icon_mad.gif" width="15"
border="0">
</td>
<td>
<img title=" :roll:" style="CURSOR: pointer"
onclick="javascript:emoticon_post(':roll:')" height="15"
alt=" :roll:"
src="smiles/icon_rolleyes.gif"
width="15" border="0">
</td>
<td>
<img title=" ;-)" style="CURSOR: pointer"
onclick="javascript:emoticon_post(';-)')" height="15" alt=" ;-)"
src="smiles/icon_wink.gif"
width="15" border="0">
</td>
<td>
<img title=" :idea:" style="CURSOR: pointer"
onclick="javascript:emoticon_post(':idea:')" height="15"
alt=" :idea:"
src="smiles/icon_idea.gif"
width="15" border="0">
</td>
<td>
<img title=" :!:" style="CURSOR: pointer"
onclick="javascript:emoticon_post(':!:')" height="15"
alt=" :!:"
src="smiles/icon_exclaim.gif"
width="15" border="0">
</td>
</tr>
<tr>
<td>
<img title=" :-P" style="CURSOR: pointer"
onclick="javascript:emoticon_post(':-P')" height="15" alt=" :-P"
src="smiles/icon_razz.gif"
width="15" border="0">
</td>
<td>
<img title=" :-D" style="CURSOR: point
没有合适的资源?快使用搜索试试~ 我知道了~
[聊天留言]CB 文本留言程序 1.01_cbv1.01.zip源码PHP项目源代码下载
共24个文件
gif:21个
php:3个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 27 浏览量
2022-03-15
15:31:20
上传
评论
收藏 14KB ZIP 举报
温馨提示
[聊天留言]CB 文本留言程序 1.01_cbv1.01.zip源码PHP项目源代码下载[聊天留言]CB 文本留言程序 1.01_cbv1.01.zip源码PHP项目源代码下载 1.适合个人搭建网站项目参考 2.适合学生毕业设计搭建网站参考 3.适合小公司搭建网站项目参考
资源推荐
资源详情
资源评论
收起资源包目录
[聊天留言]CB 文本留言程序 1.01_cbv1.01.zip (24个子文件)
[聊天留言]CB 文本留言程序 1.01_cbv1.01
cbv1.01
data_textdb.php 14B
session.php 102B
_index.php 11KB
smiles
icon_razz.gif 176B
icon_mad.gif 174B
icon_question.gif 248B
icon_confused.gif 171B
icon_exclaim.gif 236B
icon_eek.gif 170B
icon_neutral.gif 171B
start.gif 251B
icon_sad.gif 171B
icon_smile.gif 174B
icon_surprised.gif 174B
icon_wink.gif 170B
icon_cool.gif 172B
icon_rolleyes.gif 485B
icon_idea.gif 176B
icon_biggrin.gif 172B
icon_lol.gif 336B
icon_cry.gif 498B
icon_redface.gif 650B
next.gif 960B
prev.gif 960B
共 24 条
- 1
资源评论
yxkfw
- 粉丝: 76
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功