📄 write.asp
字号:
<title>签写留言</title><TABLE cellSpacing=0 cellPadding=0 width=760 align=center border=0 class=page>
<TBODY>
<TR> <td><!--#include file="top.asp"-->
<SCRIPT language="javascript">
<!--
function checkerr(string)
{
var i=0;
for (i=0; i<string.length; i++)
{
if((string.charAt(i) < '0' || string.charAt(i) > '9') && (string.charAt(i) < 'a' || string.charAt(i) > 'z')&& (string.charAt(i)!='-'))
{
return 1;
}
}
return 0;//pass
}
function del_space(s)
{
for(i=0;i<s.length;++i)
{
if(s.charAt(i)!=" ")
break;
}
for(j=s.length-1;j>=0;--j)
{
if(s.charAt(j)!=" ")
break;
}
return s.substring(i,++j);
}
function Submit()
{
uid = del_space(document.write.write.value);
if (uid.length == 0)
{
alert("请输入姓名!");
return false;
}
email = del_space(document.all("email").value);
if (email.length == 0)
{
alert("请输入Email!");
return false;
}
email = del_space(document.all("email").value);
if (email.indexOf("@")==-1)
{
alert("Email地址无效!");
return false;
}
email = del_space(document.all("email").value);
if (email.indexOf(".")==-1)
{
alert("Email地址无效!");
return false;
}
tishi = del_space(document.write.title.value);
if (tishi.length == 0)
{
alert("请输入留言标题");
return false;
}
tsda = del_space(document.write.content.value);
if (tsda.length == 0)
{
alert("请输入留言内容!");
return false;
}
return true;
}
//-->
</SCRIPT>
<%
With Response
.Write"<table cellpadding=0 cellspacing=0 border='1' bordercolor='"&table&"' style='border-collapse:collapse; width:100%' align='center'>" & Vbcrlf
.Write" <tr >" & Vbcrlf
.Write" <td width='100%' height='25' > 您现在的位置:<a href='index.asp'>网站首页</a>>><a href='book.asp'>意见留言</a></td>" & Vbcrlf
.Write" </tr>" & Vbcrlf
.Write"</table>" & Vbcrlf
.Write"<table border='0' width='100%' cellspacing='0' cellpadding='0'>" & Vbcrlf
.Write" <tr>" & Vbcrlf
.Write" <td >" & Vbcrlf
.Write" <p align='right'>" & Vbcrlf
.Write" <a href=book.asp><img border='0' src='img/view.gif' ></a></td>" & Vbcrlf
.Write" </tr>" & Vbcrlf
.Write"</table>" & Vbcrlf
.Write"<table cellpadding=0 cellspacing=0 border='1' bordercolor='"&table&"' style='border-collapse:collapse; width:100%' align='center'>" & Vbcrlf
.Write"<form method=post action=write.asp name=write onSubmit='return Submit()'>" & Vbcrlf
.Write" <tr >" & Vbcrlf
.Write" <td width='20%' height='25' > 名称:</td>" & Vbcrlf
.Write" <td height='25' > <input type='text' name='write' maxlength=10 size='20'> </td>" & Vbcrlf
.Write" <td width='15%' height='25' >" & Vbcrlf
.Write" <p align='center'>头像选择</td>" & Vbcrlf
.Write" </tr>" & Vbcrlf
.Write" <tr >" & Vbcrlf
.Write" <td width='20%' height='25' > 主页:</td>" & Vbcrlf
.Write" <td height='25' > <input type='text' name='home' maxlength=40 size='40'> </td>" & Vbcrlf
.Write" <td width='15%' height='25' >" & Vbcrlf
.Write" <p align='center'> "
.Write"<select name='face1' class='box' id='face1' onChange=document.images['face'].src=options[selectedIndex].value;>" & Vbcrlf
dim i,facestr,face
face="img/face/1.gif"
for i=1 to 30
.Write"<option "
facestr="img/face/" & i & ".gif"
.Write"value='" & facestr &"'>头像" &i &"</option>" & Vbcrlf
next
.Write"</select></td>" & Vbcrlf
.Write" </tr>" & Vbcrlf
.Write" <tr >" & Vbcrlf
.Write" <td width='20%' height='25' > Q Q:</td>" & Vbcrlf
.Write" <td height='25' > <input type='text' name='qq' maxlength=10 size='40'> </td>" & Vbcrlf
.Write" <td width='15%' height='75' rowspan='3' >" & Vbcrlf
.Write" <p align='center'> <img id=face src="&face&" alt='选择头像'></td>" & Vbcrlf
.Write" </tr>" & Vbcrlf
.Write" <tr >" & Vbcrlf
.Write" <td width='20%' height='25' > E-mail:</td>" & Vbcrlf
.Write" <td width='47%' height='25' > <input type='text' name='email' maxlength=40 size='40'> </td>" & Vbcrlf
.Write" </tr>" & Vbcrlf
.Write" <tr >" & Vbcrlf
.Write" <td width='20%' height='25' > 是否隐藏:</td>" & Vbcrlf
.Write" <td width='47%' height='25' > <input type='radio' value='true' name='show'> 是 <input type='radio' value='false' checked name='show'> 否 </td>" & Vbcrlf
.Write" </tr>" & Vbcrlf
.Write" <tr >" & Vbcrlf
.Write" <td width='20%' height='50' > 心情图片:</td>" & Vbcrlf
.Write" <td height='50' colspan='2' valign='top' >" & Vbcrlf
.Write" <input type='radio' name='emot' value='img/emot/01.gif' checked><img border='0' src='img/emot/01.gif' width='19' height='19'> "
.Write" <input type='radio' name='emot' value='img/emot/02.gif'><img border='0' src='img/emot/02.gif' width='19' height='19'> "
.Write"<input type='radio' name='emot' value='img/emot/03.gif'><img border='0' src='img/emot/03.gif' width='19' height='19'> "
.Write"<input type='radio' name='emot' value='img/emot/04.gif'><img border='0' src='img/emot/04.gif' width='19' height='19'> "
.Write"<input type='radio' name='emot' value='img/emot/05.gif'><img border='0' src='img/emot/05.gif' width='19' height='19'> "
.Write"<input type='radio' name='emot' value='img/emot/06.gif'><img border='0' src='img/emot/06.gif' width='19' height='19'> "
.Write"<input type='radio' name='emot' value='img/emot/07.gif'><img border='0' src='img/emot/07.gif' width='19' height='19'> "
.Write"<input type='radio' name='emot' value='img/emot/08.gif'><img border='0' src='img/emot/08.gif' width='19' height='19'> "
.Write"<input type='radio' name='emot' value='img/emot/09.gif'><img border='0' src='img/emot/09.gif' width='19' height='19'> "
.Write"<input type='radio' name='emot' value='img/emot/10.gif'><img border='0' src='img/emot/10.gif' width='19' height='19'><br> "
.Write"<input type='radio' name='emot' value='img/emot/11.gif'><img border='0' src='img/emot/11.gif' width='19' height='19'> "
.Write" <input type='radio' name='emot' value='img/emot/12.gif'><img border='0' src='img/emot/12.gif' width='19' height='19'> "
.Write"<input type='radio' name='emot' value='img/emot/13.gif'><img border='0' src='img/emot/13.gif' width='19' height='19'> "
.Write"<input type='radio' name='emot' value='img/emot/14.gif'><img border='0' src='img/emot/14.gif' width='19' height='19'> "
.Write"<input type='radio' name='emot' value='img/emot/15.gif'><img border='0' src='img/emot/15.gif' width='19' height='19'> "
.Write"<input type='radio' name='emot' value='img/emot/16.gif'><img border='0' src='img/emot/16.gif' width='19' height='19'> "
.Write"<input type='radio' name='emot' value='img/emot/17.gif'><img border='0' src='img/emot/17.gif' width='19' height='19'> "
.Write"<input type='radio' name='emot' value='img/emot/18.gif'><img border='0' src='img/emot/18.gif' width='19' height='19'> "
.Write"<input type='radio' name='emot' value='img/emot/19.gif'><img border='0' src='img/emot/19.gif' width='19' height='19'> "
.Write"<input type='radio' name='emot' value='img/emot/20.gif'><img border='0' src='img/emot/20.gif' width='19' height='19'></td>" & Vbcrlf
.Write" </tr>" & Vbcrlf
.Write" <tr ><input type='hidden' name='action' maxlength=20 size='40' value='save'>" & Vbcrlf
.Write" <td width='20%' height='25' > 留言标题:</td>" & Vbcrlf
.Write" <td width='85%' height='25' colspan='2' > <input type='text' name='title' maxlength=20 size='40'> </td>" & Vbcrlf
.Write" </tr>" & Vbcrlf
.Write" <tr >" & Vbcrlf
.Write" <td width='20%' height='25' > 留言内容</td>" & Vbcrlf
.Write" <td width='85%' height='25' colspan='2' > <textarea rows='11' name='content' cols='60'></textarea><br>1000个字符以内,不支持Html </td>" & Vbcrlf
.Write" </tr>" & Vbcrlf
.Write" <tr >" & Vbcrlf
.Write" <td width='100%' height='25' colspan='3' ><p align='center'><input type=submit value='提 交'> <input type=reset value='取 消'> </td>" & Vbcrlf
.Write" </tr>" & Vbcrlf
.Write"</table>" & Vbcrlf
.Write"</form>" & Vbcrlf
dim action1,write1,home1,qq1,email1,show1,emot1,face1,title1,content1
action1=trim(request("action"))
write1=trim(request("write"))
home1=trim(request("home"))
qq1=trim(request("qq"))
email1=trim(request("email"))
show1=trim(request("show"))
face1=trim(request("face1"))
emot1=trim(request("emot"))
title1=trim(request("title"))
content1=trim(request("content"))
if action1="save" then
set rs=server.CreateObject("adodb.recordset")
sql="select * from [ddbook] "
rs.open sql,conn,1,3
rs.addnew
rs("write")=write1
if home1="" then
rs("home")="about:blank"
else
rs("home")=home1
end if
rs("qq")=qq1
rs("email")=email1
rs("show")=show1
rs("emot")=emot1
rs("face")=face1
rs("title")=title1
rs("content")=content1
rs("ip")=Request.ServerVariables("REMOTE_ADDR")
rs.update
.Write"<script>alert(""留言成功!"");location.href=""book.asp"";</script>" & Vbcrlf
rs.close
end if
end with
%><!--#include file="bottom.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -