一个可分页的基于文本的PHP留言板源码
更新时间:2007年03月11日 00:00:00 作者:
<input type="radio" name="icon" value="6">
<img src="<? echo $imagedir."/6.gif"; ?>" width="15" height="15"><br>
<input type="radio" name="icon" value="7">
<img src="<? echo $imagedir."/7.gif"; ?>" width="15" height="15">
<input type="radio" name="icon" value="8">
<img src="<? echo $imagedir."/8.gif"; ?>" width="15" height="15">
<input type="radio" name="icon" value="9">
<img src="<? echo $imagedir."/9.gif"; ?>" width="15" height="15">
<input type="radio" name="icon" value="10">
<img src="<? echo $imagedir."/10.gif"; ?>" width="15" height="15">
<input type="radio" name="icon" value="11">
<img src="<? echo $imagedir."/11.gif"; ?>" width="15" height="15">
<input type="radio" name="icon" value="12">
<img src="<? echo $imagedir."/12.gif"; ?>" width="15" height="15"><br>
<input type="radio" name="icon" value="13">
<img src="<? echo $imagedir."/13.gif"; ?>" width="15" height="15">
<input type="radio" name="icon" value="14">
<img src="<? echo $imagedir."/14.gif"; ?>" width="15" height="15">
<input type="radio" name="icon" value="15">
<img src="<? echo $imagedir."/15.gif"; ?>" width="15" height="15">
<input type="radio" name="icon" value="16">
<img src="<? echo $imagedir."/16.gif"; ?>" width="15" height="15"> </p>
</div>
</p>
<p align="center">
<input type="submit" name="b1" value="写入">
<input type="reset" name="b2" value="重写">
</p>
</form>
<hr>
<?php
if(!file_exists($guestfile)){
echo "<p align="center">没有留言</p>";
}
else{
$filebuffer=file($guestfile);
$size=sizeof($filebuffer);
$pages=ceil($size/20);
echo "<p align="center">共".$size."条留言 第".$page."页/共".$pages."页<br>";
if($page>1){
$prev=$page-1;
echo "<a href="guest.php?".$prev.""><<</a> ";
}
for($i=1;$i<=$pages;$i++){
echo " <a href="guest.php?".$i."">".$i."</a> ";
}
if($page<$pages){
$next=$page+1;
echo "<a href="guest.php?".$next.""> >></a>";
}
echo "</p></font><table width="650" border="0" cellspacing="0" cellpadding="0">";
for($i=($page-1)*20; $i<$page*20 && $i<$size; $i++){
$buffer=explode("t",$filebuffer[$i]);
echo "<tr><td valign="top" width="25"><img src="".$imagedir."/".$buffer[5].".gif"></td>";
echo "<td valign="top" width="250"><p align="left">".$buffer[3]."</p></td>";
echo "<td valign="top" width="80"><p align="left"><B>(".$buffer[0].")</B></p></td>";
echo "<td valign="top" width="35"><p align="center">";
if($buffer[2]!="0"){
echo "<a href="".$buffer[2]."">主页</a>";
}
else{
echo "主页";
}
echo "</p></td>";
echo "<td valign="top" width="35"><p align="center">";
if($buffer[1]!="0"){
echo "<a href="mailto:".$buffer[1]."">E_Mail</a>";
}
else{
echo "E_Mail";
}
echo "</p></td>";
echo "<td valign="top" width="175"><p align="left">".$buffer[6]."</p></td>";
echo "</tr><tr><td> </td>";
echo "<td colspan="5" width="575">".$buffer[4]."</td></tr><tr><td> </td></tr>";
}
}
?>
</table><hr><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td>
<div align="center">本网站由<a href="mailto:gdgzljx@163.net">疯狂电脑工作室</a>制作 2000</div></td></tr></table>
</body></html>
大家可到gd9901.oso.com.cn看看效果,有什么问题请E_Mail至jaayee@21cn.com。
您可能感兴趣的文章:
相关文章
php getcwd与dirname(__FILE__)区别详解
这篇文章主要介绍了php getcwd与dirname(__FILE__)区别详解的相关资料,需要的朋友可以参考下2016-09-09
PHP+jQuery 注册模块的改进(三):更新到Smarty3.1
本文是PHP+jQuery 注册模块的改进的第三篇,主要记录了讲Smarty更新到最新的3.1版本,是篇非常使用的文章,有需要的朋友可以参考下2014-10-10


最新评论