📄 guest_add.asp
字号:
<!--#include file="tot_conn.asp" -->
<!--#include file="md5.asp" -->
<html>
<head>
<title><%=application("TOT_Title")%>留言板</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
background-image: url(images/webbg.gif);
background-position:center 50%;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style1 {
color: #FFFFFF;
font-weight: bold;
}
.style2 {color: #FF0000}
-->
</style></head>
<script src="js/inc.js"></script>
<SCRIPT language=JavaScript>
function b()
{
document.myform.id.src='images/img/'+document.myform.Image.value;
}
</SCRIPT>
<body>
<%
Function GetCode()
Dim TestObj
On Error Resume Next
Set TestObj = Server.CreateObject("Adodb.Stream")
Set TestObj = Nothing
If Err Then
Dim TempNum
Randomize timer
TempNum = cint(8999*Rnd+1000)
Session("GetCode") = TempNum
GetCode = Session("GetCode")
Else
GetCode = "<img src=""GetCode.asp"">"
End If
End Function
%>
<%=application("BBS_Head")%>
<table width="750" height="40" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="228"><div align="center">-=>您现在的位置:<a href="#">首页</a>-><a href="#">留言</a></div></td>
<td width="522" style="padding:0 60px 0 0; "><div align="right">
<%if(isAdmin) then%>
<a href="edit.asp?act=config"><img src="images/config.jpg" width="71" height="26" border="0"></a> <a href="edit.asp?act=logout"><img src="images/logout.jpg" width="71" height="26" border="0"></a>
<%end if%>
<a href="admin_login.asp"><img src="images/LoginA.gif" width="71" height="26" border="0"></a> <a href="guest_add.asp"><img src="images/LoginB.gif" width="71" height="26" border="0"></a> <a href="index.asp"><img src="images/LoginC.gif" width="71" height="26" border="0"></a></div></td>
</tr>
</table>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="12"><div align="left"><img src="images/tot_a.gif" width="12" height="16"></div></td>
<td width="726" background="images/tot_b.gif"> </td>
<td width="12"><div align="right"><img src="images/tot_c.gif" width="12" height="16"></div></td>
</tr>
<tr>
<td height="25" colspan="3" background="images/bg.gif"> <span class="style1">-=>站点公告</span></td>
</tr>
<tr>
<td colspan="3"><table width=750
border=1 align="center" cellPadding="0" cellSpacing="0" borderColor="#e6e6e6" bgcolor="#FFFFFF">
<tr>
<td align=middle width=30 height=30><div align="center"><img src="images/b.jpg" width="16" height="18"></div></td>
<td width=470><div align="center"><%=application("TOT_Content")%></div></td>
<td width=250> <font color=#e08700>■</font> 今日留言: <%=application("TOT_TodayAddNum")%> <font color=#e08700>■</font> 留言总数: <%=application("TOT_TotalAddNum")%></td>
</tr>
</table></td>
</tr>
</table>
<TABLE height=2 cellSpacing=0 cellPadding=0 width=750 align=center border=0>
<TBODY>
<TR>
<TD width=12><IMG src="images/tot_aa.gif" width="12" height="12"></TD>
<TD width=726 background=images/tot_bb.gif></TD>
<TD width=12><IMG src="images/tot_cc.gif" width="12" height="12"></TD>
</TR>
</TBODY>
</TABLE><br>
<%
dim act,a,b,c,d,e,f,randNum,rs,sql,VerifyCode
act=trim(request("act"))
if(act<>"" and act="add") then
VerifyCode =Replace(Trim(Request("VerifyCode")),"'","")
if VerifyCode <> CStr(Session("GetCode")) then
Response.Write("<script>alert(""错误:\n验证码错误"&Copyright&""");history.back();</script>")
Response.End
end if
'随机数字
randomize
a=CStr(chr((57-48)*rnd+48))
b=CStr(chr((57-48)*rnd+48))''CStr(chr((90-65)*rnd+65))
c=CStr(chr((57-48)*rnd+48))''CStr(chr((122-97)*rnd+97))
d=CStr(chr((57-48)*rnd+48))''CStr(chr((90-65)*rnd+65))
e=CStr(chr((122-97)*rnd+97))'小写字母
f=CStr(chr((90-65)*rnd+65))'大写字母
randNum=a&e&b&f&c&e&b&f&c
'添加留言
Set rs=Server.CreateObject("Adodb.Recordset")
sql="Select top 1 * from TOT_GuestBook where 1=0"
rs.Open sql,conn,3,3
rs.Addnew()
rs("cd")=md5(randNum,32)
rs("email")=Trim(Request.Form("mail"))
rs("Image")=Trim(Request.Form("Image"))
rs("Name")=Trim(Request.Form("Name"))
rs("WhereIs")=Trim(Request.Form("Where"))
rs("QQ")=Trim(Request.Form("QQ"))
rs("web")=Trim(Request.Form("web"))
rs("Password")=md5(Trim(Request.Form("Password")),32)
rs("Flag")=Trim(Request.Form("mm"))
rs("Title")=Trim(Request.Form("Title"))
rs("ip")=Request.ServerVariables("REMOTE_ADDR")
rs("Content")=Trim(Request.Form("GuestContent"))
rs("DateTime")=Now()
Session("Sessionn")="Sessionn"
rs.Update()
rs.Close()
Set rs=Nothing
application.Lock()
application("TOT_Cache")=1
application.UnLock()
Response.Write("<script>alert(""成功发表留言!"");location.href=""index.asp"";</script>")
end if
%>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="12"><div align="left"><img src="images/tot_a.gif" width="12" height="16"></div></td>
<td width="726" background="images/tot_b.gif"> </td>
<td width="12"><div align="right"><img src="images/tot_c.gif" width="12" height="16"></div></td>
</tr>
<tr>
<td height="25" colspan="3" background="images/bg.gif"> <span class="style1">-=>填写留言</span></td>
</tr>
<tr>
<td colspan="3">
<FORM name=myform onsubmit="return LoginAdd()" action="guest_add.asp?act=add" method="post">
<table width=750
border=1 align="center" cellPadding="0" cellSpacing="0" borderColor="#e6e6e6" bgcolor="#FFFFFF">
<tr>
<td width=130 height=30 align=middle bgcolor="#f7f7f7"><div align="center">选择头像:</div></td>
<td width="388">
<div align="left">
<SELECT id=e onchange=b(); size=1 name=Image>
<OPTION value="1.gif" selected>头像(1)</OPTION>
<OPTION value="2.gif">头像(2)</OPTION>
<OPTION value="3.gif">头像(3)</OPTION>
<OPTION value="4.gif">头像(4)</OPTION>
<OPTION value="5.gif">头像(5)</OPTION>
<OPTION value="6.gif">头像(6)</OPTION>
<OPTION value="7.gif">头像(7)</OPTION>
<OPTION value="8.gif">头像(8)</OPTION>
<OPTION value="9.gif">头像(9)</OPTION>
<OPTION value="10.gif">头像(10)</OPTION>
<OPTION value="11.gif">头像(11)</OPTION>
<OPTION value="12.gif">头像(12)</OPTION>
<OPTION value="13.gif">头像(13)</OPTION>
<OPTION value="14.gif">头像(14)</OPTION>
<OPTION value="15.gif">头像(15)</OPTION>
<OPTION value="16.gif">头像(16)</OPTION>
<OPTION value="17.gif">头像(17)</OPTION>
<OPTION value="18.gif">头像(18)</OPTION>
<OPTION value="19.gif">头像(19)</OPTION>
<OPTION value="20.gif">头像(20)</OPTION>
<OPTION value="21.gif">头像(21)</OPTION>
<OPTION value="22.gif">头像(22)</OPTION>
<OPTION value="23.gif">头像(23)</OPTION>
<OPTION value="24.gif">头像(24)</OPTION>
<OPTION value="25.gif">头像(25)</OPTION>
<OPTION value="26.gif">头像(26)</OPTION>
<OPTION value="27.gif">头像(27)</OPTION>
<OPTION value="28.gif">头像(28)</OPTION>
<OPTION value="29.gif">头像(29)</OPTION>
<OPTION value="30.gif">头像(30)</OPTION>
</SELECT>
</div></td>
<td width=224 rowspan="6"><div align="center"><INPUT type=hidden value=01 name=GuestImages>
<img height=90 src="images/img/1.gif" width=90 border=0 name=id></div></td>
</tr>
<tr>
<td height=30 align=middle bgcolor="#f7f7f7"><div align="center">称呼:</div></td>
<td><div align="left"><span class="dp">
<INPUT id=name name=name>
<span class="style2">*</span> 称呼限制8个字内</span></div></td>
</tr>
<tr>
<td height=30 align=middle bgcolor="#f7f7f7"><div align="center">来自哪里:</div></td>
<td><div align="left"><span class="dp">
<INPUT id=where name=where>
</span></div></td>
</tr>
<tr>
<td height=30 align=middle bgcolor="#f7f7f7"><div align="center">E-mail:</div></td>
<td><div align="left"><span class="dp">
<INPUT id=mail
name=mail>
</span></div></td>
</tr>
<tr>
<td height=30 align=middle bgcolor="#f7f7f7"><div align="center">主页:</div></td>
<td><span class="dp">
<INPUT id=web value=Http://
name=web>
</span></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -