?? add.php
字號:
<?
if( ($action == "add") && ($name != "") && ($subject != "") && ($body != "") )
{
chdir("$id/$fileid");
while( file_exists("add.tmp"))
{
$pppp ++;
}
fclose(fopen("add.tmp","w"));
$max = file("max.txt");
$maxnumber = $max[0]+1;
$handle = fopen("max.txt","w");
fputs($handle,$maxnumber);
fclose($handle);
unlink("add.tmp");
$handle = fopen("$maxnumber","w");
$name = ereg_replace("<","<",$name);
$name = ereg_replace(">",">",$name);
if( strlen($name) > 20 )
{
$name = substr($name,0,20);
}
$email = ereg_replace("<","<",$email);
$email = ereg_replace(">",">",$email);
if( strlen($email) > 50 )
{
$email = substr($email,0,50);
}
$subject = ereg_replace("<","<",$subject);
$subject = ereg_replace(">",">",$subject);
if( strlen($subject) > 100 )
{
$subject = substr($subject,0,100);
}
$body = ereg_replace("<","<",$body);
$body = ereg_replace(">",">",$body);
$body = ereg_replace("\r\n","<br>",$body);
if( strlen($body) > 20000 )
{
$body = substr($body,0,20000);
}
fputs($handle,"$name||bbs||$email||bbs||$subject||bbs||$body||bbs||".date("Y年m月d日 H:i"));
fclose($handle);
chdir("..");
?>
<script>
self.location="show.php?id=<?print($id);?>&name=<?print($fileid)?>&showdetail=yes"
</script>
<?
}
else
{
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../../default.css">
</head>
<body bgcolor="#FFFFFF" leftmargin="5" topmargin="5">
<center>
<table width="500" border="0" cellspacing="0" cellpadding="2">
<form method=post action=add.php?id=<?print($id);?>&action=add&idcn=<?print($idcn);?>&fileid=<?print($fileid)?>>
<tr bgcolor="99cc99" align="center">
<td colspan="2">添加新留言</td>
</tr>
<tr>
<td width="100" align="center">姓名</td>
<td width="400">
<input type="text" name="name" size="20" maxlength="20">
<font color="#FF0000">*</font> </td>
</tr>
<tr>
<td width="100" align="center">郵箱</td>
<td width="400">
<input type="text" name="email" size="50" maxlength="50">
</td>
</tr>
<tr>
<td width="100" align="center">主題</td>
<td width="400">
<input type="text" name="subject" size="50" maxlength="100">
<font color="#FF0000">*</font> </td>
</tr>
<tr>
<td width="100" align="center">內容</td>
<td width="400"> <font color="#FF0000">*</font></td>
</tr>
<tr>
<td colspan="2" align="center">
<textarea name="body" cols="70" rows="10"></textarea>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="Submit" value="發送">
<input type="reset" name="reset" value="重填">
</td>
</tr>
</form>
</table>
</center>
</body>
</html>
<?
}
?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -