?? addask.asp
字號:
<!--#include virtual="manage/include/conn.asp"-->
<%if request.ServerVariables("CONTENT_LENGTH")>0 then%>
<%
title=trim(request("title"))
title=replace(title,"'","‘")
content=trim(request("content"))
content=replace(content,"'","‘")
content=replace(content,chr(13),"<br>")
content=replace(content," "," ")
author=trim(request("author"))
author=replace(author,"'","’")
if title="" or content="" or author="" then
%>
<script language="javascript">
alert("請準確填寫留言信息");
setTimeout("window.close();",10);
</script>
<%
response.End()
end if
postdate=now()
set rs=conn.execute("insert into tb_BBS (title,content,backcount,readcount,author,postdate,upid) values ('"&title&"','"&content&"',0,0,'"&author&"','"&postdate&"',0)")
response.write "<center><br><h3>留言成功</h3></center>"
%>
<script language="javascript">
opener.location.reload();
setTimeout("window.close();",800);
</script>
<%else%><title>發表新留言</title>
<style type="text/css">
<!--
.style1 {
color: #2A1FAA;
font-weight: bold;
}
-->
</style>
<body leftmargin="0" topmargin="0">
<link rel="stylesheet" href="manage/include/style.css" type="text/css">
<script language="javascript">
function chkfields(){
if(document.form1.author.value==''){
alert("請輸入您的昵稱!");
form1.author.focus();
return false;
}
if (document.form1.title.value==''){
alert("請輸入您的問題標題!");
form1.title.focus();
return false;
}
if (document.form1.content.value==''){
alert("請輸入您的內容!");
form1.content.focus();
return false;
}
return true;
}
</script>
<table border="0" width="100%">
<tr>
<td bgcolor="#D0F0FF" height="40" align="center"><span class="style1"><font size="4">發布新留言</font></span></td>
</tr>
<tr>
<td align="center">
<form action="<%=request.ServerVariables("PATH_INFO")%>" method="post" name="form1" onSubmit="return chkfields();">
<table border="0" width="98%">
<tr>
<td width="22%"><div align="right">昵稱:</div></td><td width="78%"><input type="text" name="author" size="10" maxlength="10" style="border:1px solid;border-color:000000"></td>
</tr>
<tr>
<td><div align="right">標題:</div></td><td><input type="text" name="title" size="60" maxlength="50" style="border:1px solid;border-color:000000"></td>
</tr>
<tr>
<td valign="top"><div align="right">內容:</div></td><td><textarea cols="60" rows="6" name="content"></textarea></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="b1" value="提 交" style="border:1px solid;border-color:#33CCFF;background-color:#FFFFFF"> <input type="reset" name="b2" value="取 消"
style="border:1px solid;border-color:#33CCFF;background-color:#FFFFFF" onClick="window.close();">
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<%end if%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -