?? xinxi_add.asp
字號:
<!--#include file="config.asp" -->
<%
dim id
id=trim(request("id"))
if len(id)=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(id)>0 and len(name)>0 and len(about)>0 then
rs.open "select * from xinxibook",conn,3,3
rs.addnew
rs("資訊編號")=id
rs("發言者姓名")=name
rs("發言者聯系方式")=lianxi
rs("發言內容")=about
rs("發言時間")=now()
rs.update
rs.close
set rs=nothing
response.write "添加成功!<a href='xinxi.asp?id="&id&"'>點擊這里返回</a>"
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 xinxiadd()
if len(xinxi_add.name.value)=0 or getstrlen(xinxi_add.name.value)>10 then
msgbox"請輸入您的姓名!10字符以內(每個漢字占2位)"
xinxi_add.name.focus
elseif len(xinxi_add.about.value)=0 or getstrlen(xinxi_add.about.value)>240 then
msgbox"請輸入內容!240字符以內(每個漢字占2位)"
xinxi_add.about.focus
elseif len(xinxi_add.lianxi.value)>0 and xinxi_add.lianxi1.value="未留聯系方式" then
msgbox"請選擇聯系方式!"
xinxi_add.lianxi1.focus
elseif len(xinxi_add.lianxi.value)=0 and xinxi_add.lianxi1.value<>"未留聯系方式" then
msgbox"請填寫聯系方式!"
xinxi_add.lianxi.focus
else
xinxi_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="xinxi_add.asp" name="xinxi_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 xinxi where 編號=" & id,conn,1,1
response.write ("感謝您對“<font style='color:red; font-weight: bold'>" &rs("名稱")& "</font>”發表評論")
response.write ("<input type='hidden' name='id' size='29' value='"&id&"'>")
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="xinxiadd()"> <input type="reset" value=" 重 置 " name="B2"> <a href='xinxi.asp?id=<%=id%>'>點擊這里返回</a></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 + -