session_start();
$nickname=$name;
session_register("nickname");
header("location:hframe.php");
}?>
hframe.php
smessage.php
if(isset($submit)){
$fp=fopen("test.txt","a+");
$temp="rn".$rmessage."|".$content."|".$nickname."|0";
fputs($fp,$temp);
exit;
}
?>
:
session_start();
echo "";
$fl=file("test.txt");
$temp="";
for($i=0;$i<count($fl);$i++){
$sflag=explode("|",$fl[$i]);
if(($sflag[3]==0)&&$sflag[0]==$nickname){
echo"";
}else{
$temp.=$fl[$i];
}
}
$fp=fopen("test.txt","w");
fputs($fp,$temp);
?>
这只是个简单的例子,更多的修饰就靠你自己了!