📄 add.asp
字号:
<!--#include file="odbc.asp"-->
<!--#include file="head.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
select case request("act")
case "add"
call add_update()
case else
call add_main()
end select
%>
<%
sub add_main()
session("in") = "true"
if lock="1" then
errinfo="抱歉,该留言本已经被管理员锁定,无法留言"
error (errinfo)
exit sub
end if
%>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" >
<!--DWLayoutTable-->
<tr>
<td width="1" height="236" align="left" valign="top" class="tdbg_leftall">
</td>
<td width="601" valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="183" valign="top" > <div align="center"></div>
<table width="491" border="0" align="center" cellpadding="0" cellspacing="0" class="tde">
<!--DWLayoutTable-->
<tr>
<td width="489" height="25" valign="top"><table width="498%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="498" height="25" valign="bottom" background="../img/wz-bg.jpg">
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="86%" height="18"> 添加留言
<div align="right"></div></td>
<td width="14%"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td width="489" height="158" valign="top"> <table width="483" border="0" align="center" cellpadding="0" cellspacing="5">
<!--DWLayoutTable-->
<tr>
<td width="473" height="154" valign="top" class="tde"><table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr bgcolor="#F9F9F9">
<td width="100%" height="100" valign="top" bgcolor="#F9F9F9" ><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<form action="?act=add" method="post" name="add" id="add">
<tr>
<td height="35" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF"><img src="img/perinfo.gif" width="32" height="32" border="0" align="absmiddle">
个人信息:</td>
</tr>
<tr>
<td width="25%" height="25" align="right" valign="middle" bgcolor="#FFFFFF">姓名:</td>
<td bgcolor="#FFFFFF">
<input name="uid" type="text" id="uid">
必填</td>
</tr>
<tr>
<td width="25%" height="25" align="right" valign="middle" bgcolor="#FFFFFF">性别:</td>
<td bgcolor="#FFFFFF">
<input name="sex" type="radio" value="1" checked>
男
<input type="radio" name="sex" value="2">
女
<input name="sex" type="radio" value="0">
保密</td>
</tr>
<tr>
<td width="25%" height="25" align="right" valign="middle" bgcolor="#FFFFFF">主页:</td>
<td bgcolor="#FFFFFF">
<input name="home" type="text" id="home" value="http://"></td>
</tr>
<tr>
<td width="25%" height="25" align="right" valign="middle" bgcolor="#FFFFFF">email:</td>
<td bgcolor="#FFFFFF">
<input name="email" type="text" id="email"></td>
</tr>
<tr>
<td width="25%" height="25" align="right" valign="middle" bgcolor="#FFFFFF">QQ:</td>
<td bgcolor="#FFFFFF">
<input name="qq" type="text" id="qq"></td>
</tr>
<tr>
<td height="35" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
<div align="center"><img src="img/pub.gif" width="30" height="29" align="absmiddle">
留言内容:</div></td>
</tr>
<tr>
<td height="25" align="right" valign="middle" bgcolor="#FFFFFF">标题:</td>
<td height="25" align="left" bgcolor="#FFFFFF">
<input name="title" type="text" id="title">
必填</td>
</tr>
<tr>
<td height="25" align="right" valign="top" bgcolor="#FFFFFF"><br>
内容:</td>
<td height="25" align="left" bgcolor="#FFFFFF">
<textarea name="content" cols="40" rows="6" wrap="VIRTUAL" id="content"></textarea>
必填</td>
</tr>
<tr valign="middle">
<td height="30" colspan="2" align="center" bgcolor="#FFFFFF">
<input type="submit" name="Submit" value="提交">
<input type="submit" name="Submit2" value="清除">
</td>
</tr>
</form>
</table>
<%
end sub
sub add_update()
if not session("in")= "true" then
errinfo = "非法的提交动作,"
error(errinfo)
exit sub
end if
dim uid,sex,home,email,qq,utime,title,ip,content
uid = trim(request.form("uid"))
sex = Trim(request.form("sex"))
if trim(request.form("home"))="http://" then
home=""
else
home = trim(Request.Form("home"))
end if
email = Trim(request.form("email"))
qq = Trim(request.form("qq"))
title = Trim(request.form("title"))
ip = request.serverVariables("remote_addr")
content = Trim(request.form("content"))
if uid="" then
adderr=true
uiderr=true
elseif len(uid)>20 then
adderr2=true
uiderr2=true
end if
if title="" then
adderr=true
titleerr=true
elseif len(title)>50 then
adderr2 = true
titleerr2 = true
end if
if content="" then
adderr = true
contenterr = true
elseif len(content)>maxnum then
adderr2 = true
contenterr2 = true
end if
'if home<>"" then
' dim url
' url=split(home,".")
' if UBound(url)<>1 and UBound<>2 and UBound(url)<>3 and UBound(url)<>4 then
' adderr3 = true
' urlerr=true
' end if
'end if
if email<>"" then
dim email1,email2
email1= split(email,"@")
email2= split(email,".")
if UBound(email1)<>1 and Ubound(email2) = 0 then
adderr3 = true
emailerr = true
end if
end if
if Trim(request.form("qq"))<>"" then
if not (isnumeric(qq)) then
adderr3=true
qqerr=true
end if
end if
if adderr=true or adderr2=true or adderr3=true then
%>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" >
<!--DWLayoutTable-->
<tr>
<td width="1" height="236" align="left" valign="top" class="tdbg_leftall">
</td>
<td width="601" valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -