基于文本的访客签到簿
基于文本的访客签到簿,基于文本的访客签到簿
就是sign.php的源代码:
sign.php
if(isset($name)&&isset($msg)){
$name=ltrim($name);
$t=date(y年m月d日);
$dat="[".$t."]";
$msg=ltrim($msg);
$name=trim($name);
$msg=trim($msg);
$pristr=$name."  ".$dat." ".$msg."n";
$f=fopen("sign.txt","a");
fwrite($f,$pristr);
fclose($f);
}
$file=file("sign.txt");
if(!isset($pagenum)){
$pagenum=1;
}
$lesssign=0;
$num=count($file);
$dispnumed=6*($pagenum-1);
$dispnumbeg=$num-$dispnumed;
$artnumeof1=6*$pagenum;
$isdispnum=$num-$artnumeof1;
if($isdispnum<=0){
$dispnumeof=1;
$lesssign=1;
}
else{
$dispnumeof=$isdispnum+1;
}
$sign=0;
$pagec=0;
for($icount=0;($icount<$num)&&($sign==0);$icount+=6){
for($i=0;$i<=6;$i++){
if(($icount*6+$i)==$num){
$sign=1;
}
}
$pagec++;
}
$pagecount=$pagec;
echo"<table width=100% cellspacing=3";
$fuhao="◇ ";
$color=e9eae9;
$iscolor=0;
$lessnum=5;
echo"<tr<td bgcolor=00ff00 align=center";
echo"斑竹园签到簿";
echo"</td</tr";
for($i=$dispnumbeg;$i=$dispnumeof;$i--){
$linknum=$num-$i;
$lessnum--;
$stringmsg1=$file[($i-1)];
$stringmsg2=strrev($stringmsg1);
$stringmsg3=strstr($stringmsg2,"psbn");
$stringmsg=strrev($stringmsg3);
$stringlink=strstr($file[($i-1)],"http");
$dispvar=$fuhao.$stringmsg;
echo"<tr<td bgcolor=$color";
echo$dispvar;
echo "<img src="http://img.jcwcn.com/attachment/portal/jcwcj/2005-12/10/05121010"