📄 default.asp
字号:
<!--#include file="conn.asp"-->
<%tmp = "http://" & request.servervariables("SERVER_NAME") & _
left(request.servervariables("SCRIPT_NAME"),len(request.servervariables("SCRIPT_NAME"))-len("default.asp"))%>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from user"
rs.open sql,conn,1,2
scount=INT(Rs.recordcount)%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>纵横多用户留言板申请</title>
<link rel="stylesheet" type="text/css" href="style/4.css">
<script language="JavaScript">
<!--
function Juge(theForm)
{
if (theForm.user.value == "")
{
alert("请输入您的用户名!");
theForm.user.focus();
return (false);
}
if (checktext(theForm.user.value))
{
alert("请您输入有效用户名!");
theForm.user.select();
theForm.user.focus();
return (false);
}
if (theForm.pwd1.value == "")
{
alert("请输入您的密码!");
theForm.pwd1.focus();
return (false);
}
if (theForm.pwd2.value == "")
{
alert("请输入您的确认密码!");
theForm.pwd2.focus();
return (false);
}
if (theForm.email.value == "")
{
alert("请您输入\"email\"!");
theForm.email.focus();
return (false);
}
if (theForm.web.value == "")
{
alert("请您输入您的站名");
theForm.web.focus();
return (false);
}
if (theForm.url.value == "")
{
alert("请您输入您的网站地址");
theForm.url.focus();
return (false);
}
if (theForm.zhanzhang.value == "")
{
alert("请您输入站长姓名!");
theForm.zhanzhang.focus();
return (false);
}
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_@.";
var checkStr = theForm.email.value;
var allValid = true;
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
}
if (theForm.email.value.length < 6)
{
allValid = false;
}
if (!allValid)
{
alert("您输入的 \"电子邮件地址\" 无效!");
theForm.email.focus();
return (false);
}
address=theForm.email.value;
if(address.length>0)
{
i=address.indexOf("@");
if(i==-1)
{
window.alert("对不起!您输入的电子邮件地址是错误的!")
theForm.email.focus();
return false
}
ii=address.indexOf(".")
if(ii==-1)
{
window.alert("对不起!您输入的电子邮件地址是错误的!")
theForm.email.focus();
return false
}
}
if (checktext(theForm.email.value))
{
alert("请您输入有效的\"email\"!");
theForm.email.select();
theForm.email.focus();
return (false);
}
}
function checktext(text)
{
allValid = true;
for (i = 0; i < text.length; i++)
{
if (text.charAt(i) != " ")
{
allValid = false;
break;
}
}
return allValid;
}
//-->
</script>
</head>
<body>
<!--#include file="bof.asp"-->
<br><div align="center">
<center>
<table border="0" width="650" bgcolor="#000000" cellspacing="1" cellpadding="3">
<form action="reg.asp" method="POST" onSubmit="return Juge(this)">
<tr class="table001">
<td width="20%" align="right" >用户名:</td>
<td width="80%">
<input type="text" name="user" size="20" maxlength="15" class="input1">
* 1-15个字节</td>
</tr>
<tr class="table001">
<td width="20%" align="right" >密码:</td>
<td width="80%">
<input type="password" name="pwd1" size="20" maxlength="15" class="input1">
* 1-15个字节</td>
</tr>
<tr class="table001">
<td width="20%" align="right" >重复密码:</td>
<td width="80%">
<input type="password" name="pwd2" size="20" maxlength="15" class="input1">
* 1-15个字节</td>
</tr>
<tr class="table001">
<td width="20%" align="right" >站长姓名:</td>
<td width="80%">
<input type="text" size="20" maxlength="100" name="zhanzhang" class="input1">
*</td>
</tr>
<tr class="table001">
<td width="20%" align="right" >留言样式:</td>
<td width="80%">
<select name="kind" size="1">
<OPTION selected VALUE="1">金壁辉煌
<OPTION VALUE="2">粉红回忆
<OPTION VALUE="3">银灰世界
<OPTION VALUE="4">菁菁校园
<OPTION VALUE="5">白色如雪
</select>
</td>
</tr>
<tr class="table001">
<td width="20%" align="right" >E-mail:</td>
<td width="80%"><input type="text" size="40" maxlength="50" name="email" value="@" class="input1">
*</td>
</tr>
<tr class="table001">
<td width="20%" align="right" >站 名:</td>
<td width="80%"><input type="text" size="40" maxlength="50" name="web" class="input1">
*</td>
</tr>
<tr class="table001">
<td width="20%" align="right" >主页地址:</td>
<td width="80%"><input type="text" name="url" size="40" maxlength="100" value="http://" class="input1">
*</td>
</tr>
<tr class="table001">
<td width="20%" align="right" >主页简介:</td>
<td width="80%"><textarea cols="46" type="text" name="intro" rows="4" class="testarea1"></textarea>
</td>
</tr>
<tr class="table003">
<td width="20%" colspan="2" align="right">
<p align="center">
<input type="submit" value="写完了" class="input2">
<input type="reset" value="重新写" name="reset" class="input2">
</td>
</tr>
<tr class="table002">
<td width="20%" colspan="2" align="center" >共<font color=red><b><%=scount%></b></font>个网站申请,您的留言本地址就是:<%=tmp%>guestbook.asp?user=<b>你的用户名</b>
</td>
</tr>
</form>
</table>
</center>
</div><br>
<!--#include file="eof.asp"-->
</body>
</html>
<%rs.close
set rs=nothing%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -