include('head.htm');?>
function search($keyword)
{
global $content;
$count=count($content);
$subscript=0;
$ArrSearch=array();
for ($i=0;$i<$count;$i++)
{
if (ereg($keyword,$content[$i]))
{
$ArrSearch[$subscript]=ereg_replace($keyword,"
$keyword",$content[$i]);
$subscript++;
}
}
return $ArrSearch;
}//end function
$one_page_line=15;
$content = file($guestfile);
if (isset($search) and isset($keyword) and $keyword!="")
{
$content=search($keyword);
}
$count =count($content);
?>
$int_page_count=$count;//总条数;
$int_page_num=ceil($int_page_count/$one_page_line);//总页数;
echo "分页:";
for ($i=1;$i<=$int_page_num;$i++)
{
echo "".$i." ";
}
echo "";
if (isset($search) and isset($keyword) and $keyword!="")
{
echo " ";
echo "下面的留言中包含关键字$keyword共".$count."条";
}
?>
| 共有条 |