📄 citybook_add.asp
字号:
<!--#include file="config.asp" -->
<%
dim ct
ct=trim(request("ct"))
if len(ct)=0 then
response.write "<a href='javascript:history.back(1)'>请选择城市!</a>"
response.end
end if
name=trim(request.form("name"))
about=trim(request.form("about"))
if trim(request.form("lianxi1"))="未留联系方式" then
lianxi=trim(request.form("lianxi1"))
else
lianxi=trim(request.form("lianxi1")) & ":" &trim(request.form("lianxi"))
end if
set rs=server.CreateObject("adodb.recordset")
if len(ct)>0 and len(name)>0 and len(about)>0 then
rs.open "select * from citybook",conn,3,3
rs.addnew
rs("城市区号")=ct
rs("发言者姓名")=name
rs("发言者联系方式")=lianxi
rs("发言内容")=about
rs("发言时间")=now()
rs.update
rs.close
set rs=nothing
response.write "添加成功!请刷新查看!"
response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name=keywords content="<%=sitekeywords%>">
<meta name="description" content="<%=sitedescription%>">
<title>发表评论 --------------------- <%=sitename%></title>
<link href="style.css" rel="stylesheet" type="text/css">
<!--#include file="check.asp" -->
<script language="VBScript">
<!--
''=======================================================''
''函数作用:检测添加评论时的信息是否符合要求
''=======================================================''
function citybookadd()
if len(citybook_add.name.value)=0 or getstrlen(citybook_add.name.value)>10 then
msgbox"请输入您的姓名!10字符以内(每个汉字占2位)"
citybook_add.name.focus
elseif len(citybook_add.about.value)=0 or getstrlen(citybook_add.about.value)>240 then
msgbox"请输入内容!240字符以内(每个汉字占2位)"
citybook_add.about.focus
elseif len(citybook_add.lianxi.value)>0 and citybook_add.lianxi1.value="未留联系方式" then
msgbox"请选择联系方式!"
citybook_add.lianxi1.focus
elseif len(citybook_add.lianxi.value)=0 and citybook_add.lianxi1.value<>"未留联系方式" then
msgbox"请填写联系方式!"
citybook_add.lianxi.focus
else
citybook_add.submit
end if
end function
-->
</script>
</head>
<body leftmargin="0" topmargin="2" oncontextmenu="self.event.returnValue=false">
<div align="<%=sitealign%>">
<form method="POST" action="citybook_add.asp" name="citybook_add">
<TABLE cellSpacing=0 cellPadding=0 width=500 bgColor=#ffffff border=0 style="border-collapse: collapse">
<TR>
<TD width=6 height=9 background=images/paycenter_11.gif ></TD>
<TD width=482 background=images/paycenter_12.gif></TD>
<TD width=12 background=images/paycenter_13.gif></TD>
</TR>
<TR>
<TD background=images/paycenter_22.gif></TD>
<TD vAlign=top align="center">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="470">
<tr>
<td align="center" style="font-size: 10pt; color: #0066CC; font-weight: bold" colspan="2" width="470">
城市留言</td>
</tr>
<tr>
<td width="470" height="28" colspan="2">
<%set rs=server.CreateObject("adodb.recordset")
rs.open "select * from city where 区号='" & ct&"'",conn,1,1
response.write ("感谢您在“<font style='color:red; font-weight: bold'>" &rs("城市")& "市(" &rs("省份")& ")</font>”发表留言")
response.write ("<input type='hidden' name='ct' size='29' value='"&ct&"'>")
rs.close
set rs=nothing%></td>
</tr>
<tr>
<td width="90" height="28">您的大名:</td>
<td width="380">
<input type="text" name="name" size="29"> <font color="#FF3300">* </font>
(如:小宝,Tom)</td>
</tr>
<tr>
<td width="90" height="28">联系方式:</td>
<td width="380"><select size="1" name="lianxi1">
<option value="未留联系方式">未留联系方式</option>
<option value="手机">手机</option>
<option value="电话">电话</option>
<option value="Email">Email</option>
<option value="QQ">QQ</option>
<option value="MSN">MSN</option>
</select> <input type="text" name="lianxi" size="31"></td>
</tr>
<tr>
<td width="90" height="28">发表内容:</td>
<td width="380"><textarea rows="4" name="about" cols="45"></textarea>
<font color="#FF3300">*</font></td>
</tr>
<tr>
<td width="90" height="28"> </td>
<td width="380"><input type="button" value=" 提 交 " name="add" onclick="citybookadd()"> <input type="reset" value=" 重 置 " name="B2"></td>
</tr>
</table>
</TD>
<TD background=images/paycenter_23.gif></TD></TR>
<TR>
<TD width=6 height=12 background=images/paycenter_31.gif></TD>
<TD background=images/paycenter_32.gif></TD>
<TD width=12 background=images/paycenter_33.gif></TD>
</TR>
</TABLE>
</form>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -