📄 gb_write.asp
字号:
<!--#include file="top.asp"-->
<script language=javascript>
<!--
function newin(width,height,url,name) {
msgWindow=window.open(url,name,'statusbar=no,scrollbars=no,status=no,resizable=no,width='+width+',height='+height)
}
// -->
</script>
</head>
<div align="center">
<table border="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" width="980">
<tr>
<td valign="top" width="181" align="center"><!--#include file="log.asp"--></td>
<td valign="top" align="center">
<table border="0" cellpadding="5" style="border-collapse: collapse" bordercolor="#111111" width="98%">
<%
if request("action")="post" then
venip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If venip="" Then venip=Request.ServerVariables("REMOTE_ADDR")
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from venshop_gb"
rs.open sql,conn,1,3
rs.Addnew
rs("name")=DelStr(Request("name"))
rs("email")=DelStr(Request("email"))
rs("oicq")=DelStr(Request("oicq"))
rs("content")=DelStr(Request("content"))
rs("photo")=DelStr(Request("photo"))
rs("ip")=venip
rs("riqi")=date()
rs.Update
rs.Close
Set rs=Nothing
Response.Redirect"gb.asp"
else%>
<tr><td width="100%" height="30"><a href="index.asp">首页</a> - <a href="gb.asp">留言簿</a> - 添加留言</td></tr>
<tr><td width="100%" height="1" background="Img/gb_bg.gif"></td></tr>
<tr><td width="100%">
<script language="JavaScript">
<!--
if (parent.frames.length > 0) {
parent.location.href = location.href;
}
function regform_onsubmit()
{
if(checkspace(document.regform.name.value)) {
document.regform.name.focus();
alert("Please fill in your name!");
return false;
}
else if(checkspace(document.regform.content.value)) {
document.regform.content.focus();
alert("Please fill in your Feedback!");
return false;
}
else if(checkspace(document.regform.content.value) || document.regform.content.value.length < 2) {
document.regform.content.focus();
alert("Your Feedback must be more than 2 characters!");
return false;
}
else if(document.regform.email.value.length!=0)
{
if (document.regform.email.value.charAt(0)=="." ||
document.regform.email.value.charAt(0)=="@"||
document.regform.email.value.indexOf('@', 0) == -1 ||
document.regform.email.value.indexOf('.', 0) == -1 ||
document.regform.email.value.lastIndexOf("@")==document.regform.email.value.length-1 ||
document.regform.email.value.lastIndexOf(".")==document.regform.email.value.length-1)
{
alert("You fill in a wrong email address!");
document.regform.email.focus();
return false;
}
}
else
{
alert("Please fill in your Email!");
document.regform.email.focus();
return false;
}
}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
// -->
</script>
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<form action="gb_write.asp?action=post" method="POST" name="regform" language="javascript" onsubmit="return regform_onsubmit()">
<tr><td width="100" align="right">昵称:</td><td><input type="text" name="name" size="20"><font color="#FF0000">*</font></td></tr>
<tr><td width="100" align="right">性别:</td><td><select size="1" name="photo"><option value="1" selected>男</option><option value="2">女</option></select></td></tr>
<tr><td width="100" align="right">邮箱:</td><td><input type="text" name="email" size="20"><font color="#FF0000">*</font></td></tr>
<tr><td width="100" align="right">QQ:</td><td><input type="text" name="oicq" size="20"></td></tr>
<tr><td width="100" align="right">留言:</td><td><textarea rows="4" name="content" cols="36"></textarea></td></tr>
<tr><td align="center"></td><td height="100" valign="top"><input type="submit" name="submit" value="提交"> <input type="reset" name="reset" value="清除"></td></tr>
</form>
<%end if%>
</table>
</td></tr></table>
</td></tr></table></div>
<!--#include file="copy.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -