📄 gbook.asp
字号:
<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = 0
%>
<!--#include file="chkuser.asp"-->
<!--#include file="config.asp"-->
<!--#include file="inc/user.asp"-->
<%
username=Request.Cookies("username")
sql="select * from gbuser where username='"&username&"'"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
response.write "<script language=javascript>alert('您的留言本还没有开通\n\n点击[确定]将立即开通!')</script>"
set rs1=Server.CreateObject("ADODB.Recordset")
sql1="select * from counter"
rs1.open sql,conn,1,3
rs1.addnew
rs1("username")=username
rs1("state")=True
rs1("date")=Date()
rs1.update
response.write "<script language=javascript>alert('您的留言本已经开通!');location.href='gbook.asp'</script>"
rs1.close
set rs1=nothing
end if
if request("action")="edit" then
set rs2=Server.CreateObject("ADODB.Recordset")
sql2="select * from gbuser where username='"&username&"'"
rs2.open sql,conn,1,3
rs2("uphtml")=request.Form("uphtml")
rs2("downhtml")=request.Form("downhtml")
rs2("state")=request.Form("state")
rs2.update
response.write "<script language=javascript>alert('修改成功!');location.href='gbook.asp'</script>"
rs2.close
set rs2=nothing
end if
%>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/style.css" rel="stylesheet" type="text/css">
<title></title>
</head>
<body bgcolor="#F6ECE2">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="70%">
<tr>
<td align="center">
<fieldset style="padding: 2; width:200; height:120">
<legend><b>网站留言本</b></legend>
<table width=450 align="center" cellpadding=3 cellspacing=1>
<form name="form1" action="?action=edit" method="post" onSubmit="javascript:form1.Submit.disabled=true;">
<tr>
<td colspan="2"><p>提示:<br>
1.请在您网站加上此留言本的链接<br>
2.需要回复或删除留言,必须先登录用户管理中心</p> </td>
</tr>
<tr>
<td>留言本地址:</td>
<td width="331"><a href="gbook/index.asp?username=<%=Request.Cookies("username")%>" target="_blank">按此打开您的留言本</a></td>
</tr>
<tr>
<td>留言本顶部html:</td>
<td><textarea name="uphtml" cols="40" rows="4"><%=rs("uphtml")%></textarea></td>
</tr>
<tr>
<td width="102">留言本底部html:</td>
<td><textarea name="downhtml" cols="40" rows="4" id="textarea"><%=rs("downhtml")%></textarea></td>
</tr>
<tr>
<td>留言本开关</td>
<td><input type="radio" name="state" value="True" <%if rs("state")=True then response.write "checked"%>>
打开
<input type="radio" name="state" value="False" <%if rs("state")=False then response.write "checked"%>>
关闭 </td>
</tr>
<tr>
<td>开通日期:</td>
<td><%=formatdatetime((rs("date")),1)%></td>
</tr>
<tr align="center">
<td colspan="2"><input name="Submit" type="submit" class="button" value="提交"></td>
</tr></form>
</table>
</fieldset></td>
</tr>
</table>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -