📄 saveadd.php
字号:
<?
/* ----------------------------------------------------
-------------------------------------------------------- */
?>
<html>
<head>
<title><? echo $gbookname; ?></title>
<style type="text/css">
<!--
a:hover { font-family: "宋体"; font-size: 12px; color: #0000FF; text-decoration: none}
a:link { font-family: "宋体"; font-size: 12px; text-decoration: none; color: #333333}
a:visited { font-family: "宋体"; font-size: 12px; text-decoration: none; color: #333333}
td { font-family: "宋体"; font-size: 12px}
-->
</style>
</head>
<script language=javascript>
<!--
function mOvr(src){ if (!src.contains(event.fromElement)){src.bgColor = '#ffFFFF';src.children(0).style.color='#000000'}}
function mOut(src){ if (!src.contains(event.toElement)){src.bgColor = '#ebebeb';src.children(0).style.color='#000000'}}
-->
</script>
<body topMargin=5 bgcolor="#ffffff" text="#000000" link="#4682B4" vlink="#4682B4" background="img/lines.gif">
<table width="70%" border="0" cellspacing="0" cellpadding="0" align=center>
<tr>
<td width="15"><img alt="" src="img/imac_scrn_1.gif" width="15" height="16" /></td>
<td background="img/imac_scrn_3.gif" width="100%"><img alt=""
src="img/spacer.gif" width="10" height="16" /></td>
<td width="16"><img alt="" src="img/imac_scrn_5.gif" width="16" height="16" /></td>
</tr>
<tr>
<td width="15" background="img/imac_scrn_9.gif"><img alt=""
src="img/spacer.gif" width="15" height="60" /></td>
<td align="center">
<?
require("config.php");
if (empty($name)||empty($text))
{
echo "<br><br><center>请输入必要的信息<br><a href='javascript:history.back();'>
返回</a></center>";
exit();
}
if (!file_exists("data/$user")) {
echo "<br><br><center>该用户留言本不存在<br><a href='javascript:history.back();'>
返回</a></center>";
exit();
}
function safe_convert($s) {
$s=str_replace("|","│",$s);
$s=str_replace("<","<",$s);
$s=str_replace(">",">",$s);
$s=str_replace("\r","",$s);
$s=str_replace("\t","",$s);
$s=str_replace("\n","<br>",$s);
$s=str_replace(" "," ",$s);
return $s; }
//-----------------安检-------------------
$text=safe_convert($text);
$name=trim($name);
$name=safe_convert($name);
$mail=trim($mail);
$mail=safe_convert($mail);
$url=trim($url);
$url=safe_convert($url);
$oicq=trim($oicq);
$oicq=safe_convert($oicq);
$img=safe_convert($img);
$total=strlen($name.$url.$text.$mail.$oicq.$img);
if ($total>1000000) { echo "请简单点,字太多了"; exit(); } /* 设置留言的长度*/
//-----------------安检-------------------
if (empty($url)) { $url="http://"; }
if (empty($mail)) { $mail="不告诉你"; }
if (empty($oicq)) { $oicq="不告诉你"; }
$time=time();
$date=date("Y-m-d H:i:s");
$ip=GETENV("REMOTE_ADDR");
$newline=$time."|".$name."|".$url."|".$text."|".$mail."|".$oicq."|".$date."|".$img."|".$ip."\n";
$old=file("data/$user");
$num=count($old);
$fp=fopen("data/$user","w");
flock($fp,1);
fputs($fp,$newline);
for ($i=0;$i<$num;$i++){
fputs($fp,$old[$i]);
}
fclose($fp);
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">";
echo "<HTML><HEAD><TITLE>发表文章</TITLE>";
echo "<META content=\"text/html; charset=gb2312\" http-equiv=Content-Type>";
echo "<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"2;URL=gbook.php?user=admin\">";
echo "</head><body topmargin=\"0\"><br>";
echo "<ul>谢谢您的留言!现在将自动返回留言薄首页.<br>";
echo " <br>";
echo " <br></font>";
echo "<a href=gbook.php?user=admin>如果你的浏览器没有自动的返回到留言簿首页,或者你不想再等待,请点这里返回.";
echo "</font></a></ul>";
?>
</td>
<td width="16" background="img/imac_scrn_10.gif"><img alt=""
src="img/spacer.gif" width="15" height="60" /></td>
</tr>
<tr>
<td width="15"><img alt="" src="img/imac_scrn_13.gif" width="15" height="16" /></td>
<td background="img/imac_scrn_14.gif" width="100%"><img alt=""
src="img/spacer.gif" width="10" height="16" /></td>
<td width="16"><img alt="" src="img/imac_scrn_11.gif" width="16" height="16" /></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -