?? write.asp
字號(hào):
<!--#include file="setup.asp"-->
<!--#include file="inc/check.asp"-->
<%
sql="select * from gbook order by id desc"
set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open sql,conn,1,1
if Request("menu") = "addto" then
call addto()
else call index()
end if
sub index()
%>
<html><head><title><%=gbook_name%>--添加留言</title>
<link rel="stylesheet" href="../css/admin.css">
</head>
<body topmargin=0 >
<table width=600 height="27" border=1 bordercolor="#FFFFFF"align="center" cellpadding=0 cellspacing=0 style="border: 1px solid #CCCCCC;">
<tr>
<td height="27">
<DIV align=right> 【<a href="index.asp">查看留言</a>】 【<a href="write.asp">簽寫留言</a>】</DIV></td>
</tr>
</table>
<script language="JavaScript1.2">
<!--
clckcnt = 0;
var postmaxchars = <%=bodymax%>;
function clckcntr(eventobject){if(event.ctrlKey && window.event.keyCode==13){clckcnt++;if (clckcnt>1)
{alert('留言正在提交,請(qǐng)耐心等待!');return false;}document.FORM.Submit.disabled = true; this.document.FORM.submit();}}
function validate(theform) {
if (theform.username.value=="" || theform.body.value=="" ||theform.zt.value=="") {
alert("'姓名' 和 '留言主題' 和 '留言內(nèi)容' 是必須填寫的!");
clckcnt=0;
return false; }
if (postmaxchars != 0) {
if (theform.body.value.length > <%=bodymax%>) {
alert("你的信息太長(zhǎng)了.\n\n請(qǐng)限制在 "+<%=bodymax%>+" 字節(jié)以內(nèi).\n當(dāng)前已有 "+theform.body.value.length+" 字節(jié).");
clckcnt=0;
return false; }
else { document.FORM.Submit.disabled = true; return true; }
} else {
document.FORM.Submit.disabled = true; return true; }
}
function checklength(theform) {
if (postmaxchars != 0) { message = "\n最大的字符為 "+<%=bodymax%>+" 字節(jié)."; }
else { message = ""; }
alert("你的信息已經(jīng)有 "+theform.body.value.length+" 字節(jié)."+message);
}
-->
</script>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" background="images/main_bg.gif">
<tr>
<td width="599" valign="top" background="images/main_bg.gif">
<table width="599" border="0" align="center" cellspacing="0" cellpadding="0">
<tr>
<td width="599" height="305" bgcolor="#999999" background="images/main_bg.gif">
<form name="FORM" method="POST" action="write.asp" onSubmit="return validate(this)">
<%session("OldGuestSave")=""%>
<input type=hidden name=menu value=addto>
<input type=hidden name=ip value=<%=Request.ServerVariables("REMOTE_ADDR")%>>
<table width="100%" border="0" cellspacing="0" cellpadding="4" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF" bgcolor="#CCCCCC">
<tr bgcolor="#ebebeb">
<td width="18%" align="center" nowrap bgcolor="#f7f7f7" background="images/main_bg.gif"><font color="#FF0000">*</font>你的大名:</td>
<td width="82%" bgcolor="#f7f7f7"> <input type="text" name="username" size="20" style="background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#F7FBFF'" onMouseOut = "this.style.backgroundColor = ''">
</td>
</tr>
<tr bgcolor="#ebebeb">
<td width="18%" align="center" nowrap bgcolor="#f7f7f7" background="images/main_bg.gif"><font color="#FF0000">*</font>留言主題:</td>
<td width="100%" bgcolor="#f7f7f7">
<input name="zt" type="text" id="zt" style="background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#F7FBFF'" onMouseOut = "this.style.backgroundColor = ''" size="50">
</td>
</tr>
<tr bgcolor="#ebebeb">
<td width="18%" align="center" nowrap bgcolor="#f7f7f7" background="images/main_bg.gif"><font color="#FF0000">*</font>留言內(nèi)容:</td>
<td width="82%" bgcolor="#f7f7f7"> <textarea name="body" onkeydown=clckcntr(); cols="60" rows="6" wrap=hard style="background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#F7FBFF'" onMouseOut = "this.style.backgroundColor = ''"><%=Request.QueryString("body")%></textarea>
</td>
</tr>
<tr bgcolor="#ebebeb">
<td width="18%" height="12" align="center" nowrap bgcolor="#f7f7f7" background="images/main_bg.gif">你的主頁:</td>
<td width="82%" height="12" bgcolor="#f7f7f7"> <input type="text" name="homeurl" size="20" style="background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#F7FBFF'" onMouseOut = "this.style.backgroundColor = ''" value="http://">
<a href="javascript:checklength(document.FORM);">[查看帖子長(zhǎng)度]</a>
</td>
</tr>
<tr bgcolor="#ebebeb">
<td align="center" nowrap bgcolor="#f7f7f7" background="images/main_bg.gif">你的郵件:</td>
<td width="82%" bgcolor="#f7f7f7"><input type="text" name="email" size="20" style="background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#F7FBFF'" onMouseOut = "this.style.backgroundColor = ''"></td>
</tr>
<tr bgcolor="#ebebeb">
<td width="18%" align="center" nowrap bgcolor="#f7f7f7" background="images/main_bg.gif">你的OICQ:</td>
<td width="82%" bgcolor="#f7f7f7"> <input type="text" name="qq" size="20" style="background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#F7FBFF'" onMouseOut = "this.style.backgroundColor = ''">
</td>
</tr>
<tr bgcolor="#ebebeb">
<td width="18%" height="12" align="center" nowrap bgcolor="#f7f7f7" background="images/main_bg.gif">您的表情:</td>
<td width="82%" height="12" bgcolor="#f7f7f7"> <input name="brow" type="radio" value="images/brow/1.gif" checked>
<img src="images/brow/1.gif"> <input type="radio" value="images/brow/2.gif" name="brow">
<img src="images/brow/2.gif"> <input type="radio" value="images/brow/3.gif" name="brow">
<img src="images/brow/3.gif"> <input type="radio" value="images/brow/4.gif" name="brow">
<img src="images/brow/4.gif"> <input type="radio" value="images/brow/5.gif" name="brow">
<img src="images/brow/5.gif"> <input type="radio" value="images/brow/6.gif" name="brow">
<img src="images/brow/6.gif"> <input type="radio" value="images/brow/7.gif" name="brow">
<img src="images/brow/7.gif"> <input type="radio" value="images/brow/8.gif" name="brow">
<img src="images/brow/8.gif"> <br> <input type="radio" value="images/brow/9.gif" name="brow">
<img src="images/brow/9.gif"> <input type="radio" value="images/brow/10.gif" name="brow">
<img src="images/brow/10.gif"> <input type="radio" value="images/brow/11.gif" name="brow">
<img src="images/brow/11.gif"> <input type="radio" value="images/brow/12.gif" name="brow">
<img src="images/brow/12.gif"> <input type="radio" value="images/brow/13.gif" name="brow">
<img src="images/brow/13.gif"> <input type="radio" value="images/brow/14.gif" name="brow">
<img src="images/brow/14.gif"> <input type="radio" value="images/brow/15.gif" name="brow">
<img src="images/brow/15.gif"> <input type="radio" value="images/brow/18.gif" name="brow">
<img src="images/brow/18.gif"> <br> </td>
</tr>
<tr bgcolor="#ebebeb"> <!-- -->
<td width="18%" height="2" align="center" nowrap bgcolor="#f7f7f7" background="images/main_bg.gif">選擇頭像:</td>
<td width="82%" height="2" nowrap bgcolor="#f7f7f7">
<input name="face" type="radio" value="images/face/1.gif" checked>
<img src="images/face/1.gif" width="32" height="32"> <input type="radio" name="face" value="images/face/2.gif">
<img src="images/face/2.gif" width="32" height="32"> <input type="radio" name="face" value="images/face/3.gif">
<img src="images/face/3.gif" width="32" height="32"> <input type="radio" name="face" value="images/face/4.gif">
<img src="images/face/4.gif" width="32" height="32"> <input type="radio" name="face" value="images/face/5.gif">
<img src="images/face/5.gif" width="32" height="32"> <input type="radio" name="face" value="images/face/6.gif">
<img src="images/face/6.gif" width="32" height="32"> <input type="radio" name="face" value="images/face/7.gif">
<img src="images/face/7.gif" width="32" height="32"><br> <input type="radio" name="face" value="images/face/8.gif">
<img src="images/face/8.gif" width="32" height="32"> <input type="radio" name="face" value="images/face/9.gif">
<img src="images/face/9.gif" width="32" height="32"> <input type="radio" name="face" value="images/face/10.gif">
<img src="images/face/10.gif" width="32" height="32"> <input type="radio" name="face" value="images/face/11.gif">
<img src="images/face/11.gif" width="32" height="32"> <input type="radio" name="face" value="images/face/12.gif">
<img src="images/face/12.gif" width="32" height="32"> <input type="radio" name="face" value="images/face/13.gif">
<img src="images/face/13.gif" width="32" height="32"> <input type="radio" name="face" value="images/face/14.gif">
<img src="images/face/14.gif" width="32" height="32"> </td>
</tr>
<tr bgcolor="#f7f7f7">
<td colspan="2" align="center" nowrap bgcolor="#f7f7f7" background="images/main_bg.gif">
<input type="submit" name="Submit" value="添 加" onclick="return clckcntr();" style="backgroud-color: #ffffff; border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; FONT-FAMILY: 宋體; FONT-SIZE: 9pt; HEIGHT: 18px; WIDTH: 50px">
<input type="reset" name="Submit2" value="重 置" style="backgroud-color: #ffffff; border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; FONT-FAMILY: 宋體; FONT-SIZE: 9pt; HEIGHT: 18px; WIDTH: 50px">
<input type="button" name="Submit3" value="取 消" onClick="javascript:history.back(-1);" style="backgroud-color: #ffffff; border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; FONT-FAMILY: 宋體; FONT-SIZE: 9pt; HEIGHT: 18px; WIDTH: 50px">
</td>
</tr></form>
</table>
</td>
</tr>
</table></td>
</tr>
</BODY></HTML>
<%
call htmlend()
Response.End
end sub
sub addto()
dim username, email, homeurl, qq, body, addtime, sql, Rs, ip, face, brow
username=htmlencode2(trim(Request.form("username")))
zt=htmlencode2(trim(Request.form("zt")))
email=htmlencode2(trim(Request.form("email")))
homeurl=htmlencode2(trim(Request.form("homeurl")))
qq=htmlencode2(trim(Request.form("qq")))
body=htmlencode2(Request.form("body"))
face=Request.form("face")
ip=Request.ServerVariables("REMOTE_ADDR")
brow=Request.form("brow")
if session("OldGuestSave") <> "" then
message1="請(qǐng)不要重復(fù)提交同一條信息嘛!\n"
end if
if username = "" then
message="請(qǐng)?zhí)顚懩拿峙叮n"
end if
if zt = "" then
message="請(qǐng)?zhí)顚懥粞灾黝}!\n"
end if
if email <> "" and IsValidEmail(email)=false then
message=message&"您的電子郵件是不是錯(cuò)了?\n"
end if
if qq <> "" and isInteger(qq) = false then
message=message&"對(duì)不起,您所填寫的 QQ 號(hào)碼不是數(shù)字哦,這樣是不行的!\n"
end if
if qq <> "" and len(qq) < 4 then
message=message&"好像沒有小于4位號(hào)碼的QQ吧?\n"
end if
if qq <> "" and len(qq) > 11 then
message=message&"好像還沒有超過11位號(hào)碼的QQ吧!\n"
end if
if qq = "" then
qq="不告訴你"
end if
if body = "" then
message=message&"留言內(nèi)容不能為空!\n"
end if
if face = "" then
facerand=16
randomize
facerand=Int((facerand*rnd)+1)
face="images/face/"&facerand&".gif"
end if
if body <> "" and Len(body)> bodymax then
message=message&"對(duì)不起,留言字?jǐn)?shù)不能超過 "&bodymax&" 字,謝謝!\n"
end if
if brow = "" then
browrand=16
randomize
browrand=Int((browrand*rnd)+1)
brow="images/brow/"&browrand&".gif"
end if
if message1<> "" then call error1(""&message1&"")
if message<> "" then
call error(""&message&"")
else
sql = "select * from gbook"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open sql,conn,3,2
Rs.addnew
Rs("username")=username
Rs("zt")=zt
Rs("email")=email
Rs("homeurl")=homeurl
Rs("qq")=qq
Rs("body")=body
Rs("face")=face
Rs("brow")=brow
Rs("ip")=ip
Rs("addtime")=now
Rs.update
Rs.close
session("OldGuestSave")="Saved"
sql="select * from admin"
Rs.open sql,conn,3,2
if date <> today_time then
Rs("today_count") = 1
else
Rs("today_count") = Rs("today_count")+1
end if
Rs("today_time") = date
Rs.update
Rs.close
set Rs = nothing
conn.close
set conn = nothing
Response.redirect "index.asp"
Response.End
end if
end sub
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -