📄 lword.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/gym.asp" -->
<!--#include file="inc/is_user.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>给站长留言</title>
<style type="text/css">
<!--
@import url("style.css");
-->
</style>
</head>
<%
dim title,word,check,lword
'接收表单数据-----------
title=request.Form("title")
word=request.Form("word")
if title="" and word="" then
'表单数据为空时认为处于未留言状态----------
lword=1
else
'表单数据非空时进行数据检查----------
check=""
if title="" then check="●没有输入留言标题<br>"
if word="" then check=check & "●没有输入留言内容<br>"
if len(title) > 50 then check=check & "●标题超过50个字符<br>"
if len(word) > 250 then check=check & "●留言超过250个字符<br>"
end if
%>
<body>
<div align="center">
<table width="706" height="281" border="0" class="table_big">
<tr>
<td valign="top"><div align="center">
<!--#include file="inc/head.asp" -->
<% If lword=1 Then %>
<br>
<form name="form1" method="post" action="">
<table width="532" border="0" class="table_small">
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="4" class="text_title"><div align="left">站长留言</div></td>
</tr>
<tr>
<td colspan="4" class="table_title"> </td>
</tr>
<tr class="text">
<td width="40" class="text"><div align="left">标题: </div></td>
<td colspan="3" class="text"><div align="left">
<input name="title" type="text" class="textfield" id="title">
</div></td>
</tr>
<tr class="text">
<td valign="top" class="text"><div align="left">内容: </div></td>
<td colspan="3" valign="top"><div align="left">
<textarea name="word" class="textfield2" id="word"></textarea>
</div></td>
</tr>
<tr>
<td colspan="4" valign="top"> </td>
</tr>
<tr>
<td> </td>
<td width="58"> </td>
<td width="51"><input name="lword" type="submit" class="button_" id="lword" value="留言"></td>
<td width="361"><div align="left">
<input name="reset" type="reset" class="button_" id="reset" value="清空">
</div></td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
</table>
</form>
<% Else %>
<% If check<>"" Then %>
<br>
<table width="480" border="0" class="table_small">
<tr>
<td> </td>
</tr>
<tr>
<td class="text_title">
<div align="left">留言错误!</div></td>
</tr>
<tr>
<td class="table_title"> </td>
</tr>
<tr>
<td class="text_error"><div align="left"><%= check %></div></td>
</tr>
<tr>
<td class="text"><div align="center">[<a href="lword.asp">返回留言页面</a>]</div></td>
</tr>
<tr>
<td class="text_error"> </td>
</tr>
</table>
<% Else %>
<%
set rs_word=server.CreateObject("adodb.recordset")
sql="select * from word where user_name ='" & session("user_name") & "'"
rs_word.open sql,gym_conn,3,2
'获取当前用户的留言次数--------------
num=rs_word.recordcount
rs_word.close
sql="select * from word"
rs_word.open sql,gym_conn,3,2
'写入留言信息----------------
rs_word.addnew
rs_word("user_name")=session("user_name")
rs_word("datetime")=now()
rs_word("title")=title
rs_word("word")=word
rs_word.update
rs_word.close
%>
<br>
<table width="480" border="0" class="table_small">
<tr>
<td> </td>
</tr>
<tr>
<td class="text_title"><div align="left">留言成功</div></td>
</tr>
<tr>
<td class="table_title"> </td>
</tr>
<tr>
<td class="text"><div align="left"><%= "您给站长的留言一共有" & (num+1) & "条" %> </div></td>
</tr>
<tr>
<td class="text"><div align="center">[<a href="index.asp" class="text">返回首页</a>]</div></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<% End If %>
<% End If %>
<br>
<!--#include file="inc/foot.asp" -->
<br>
</div></td>
</tr>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -