📄 post.php
字号:
<?php
include('sys.php');
if($name==""||$text=="")
{
print("错误!,你没有写名字或内容,请返回!");
echo "<meta http-equiv=Refresh content=1;url=javascript:history.back(1)>";
}
else
{
$mail=htmlspecialchars($mail);$mail=StripSlashes($mail);
$name=htmlspecialchars($name);$name=StripSlashes($name);$name=safe_convert($name);
$text=StripSlashes($text);$text=safe_convert($text);
$filelists=file("gb/list.php");
$count=count($filelists);
$count--;
$filelist=$filelists[$count];
$number=$filelist;
$filecount=$number+1;
$filename="gb/id_$filecount";
writetofile("$filename","$name||$mail||$homepage||$text||$ip||$oicp||$face||".date( "Y.m.d H:i:s"."\n" ));
$count=$filecount;
writetofile("gb/list.php","$count"."\n");
echo"感谢你的留言!系统正在返回.....";
echo "<meta http-equiv=Refresh content=2;url=index.php>";
}
function writetofile($filename,$book)
{
$fd=fopen("$filename","a+");
fwrite($fd,$book);
fclose($fd);
}
function getfromlist($file)
{
$fp=fopen("$file","a+");
$list=fgets($fp,5);
fclose($fp);
return $list;
}
function safe_convert($d) {
$d = str_replace("\t","",$d);
$d = str_replace("<","<",$d);
$d = str_replace(">",">",$d);
$d = str_replace("\r","<br>",$d);
$d = str_replace("\n","",$d);
$d = str_replace("|","│",$d);
$d = str_replace(" "," ",$d);
return $d;
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -