S
shhw
Unregistered / Unconfirmed
GUEST, unregistred user!
当提交注册信息时会变得非常的慢。
只有再点击一次提交按钮时才可以提交成功。
请问是上面原因
单元代码如下:
<%@LANGUAGE="VBSCRIPT"
CODEPAGE="936"%>
<!--#include file="Conn.asp"-->
<%
action=Request("action"
userName=trim(Request.Form("userName")
UserPass=trim(Request.Form("UserPass")
RUserPass=trim(Request.Form("RUserPass")
TrueName=trim(Request.Form("TrueName")
SEx=Request.Form("SEx"
Age=Request.Form("Age"
Native=Request.Form("Native"
Marriage=Request.Form("Marriage"
character=Request.Form("character"
WorkType=Request.Form("WorkType"
Duty=Request.Form("Duty"
Indvove=Request.Form("Indvove"
tAddress=Request.Form("tAddress"
if action ="yes"
then
set rs=Server.CreateObject("adodb.recordset"
rs.open "select * from EmpINfo ",conn,1,3
rs.addnew
rs("userName"=userName
rs("PassWord"=UserPass
rs("EmpName"=TrueName
rs("SEx"=SEx
rs("Age"=Age
rs("Native"=Native
rs("Espousal"=Marriage
rs("character"=character
rs("WorkType"=WorkType
rs("Duty"=Duty
rs("Indvlove"=Indvove
rs("Address"=tAddress
rs.update
rs.close
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html;
charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.style1 {font-size: larger;font-size: 12px}
.style4 {color: #999999;
font-size: x-large;
}
.style5 {font-family: "宋体"}
.style6 {font-size: larger;font-size: 12px}
-->
</style>
</head>
<script language="javascript">
<!--
function userlogin()
{
if (document.form1.userName.value==""{
alert("名称不能为空!"
do
cument.form1.userName.focus();
return false
}
if (document.form1.UserPass.value==""{
alert("密码不能为空!"
do
cument.form1.UserPass.focus();
return false
}
if (document.form1.UserPass.value!=document.form1.RUserPass.value){
alert("两次输入的密码不一致!"
do
cument.form1.RUserPass.focus();
return false
}
return true
}
function reset_form()
{
do
cument.form1.userName.value="";
do
cument.form1.UserPass.value="";
do
cument.form1.RUserPass.value="";
do
cument.form1.userName.focus;
}
//-->
</script>
<body>
<h1 align="center"><span class="style1"><span class="style4">
<label><strong>用户注册</strong></label>
</span> </span> </h1>
<form name="form1"
method="post"
action="?action=yes">
<table width="677"
height="372"
border="1"
align="center"
bordercolor="#9933FF">
<tr>
<td width="704"
height="353"
align="left"
valign="top"
class="style6"> <table width="100%"
height="225"
border="0">
<tr>
<td width="82"
height="29"
align="right"
valign="middle"> <div align="right">*名称:</div></td>
<td width="140"
align="left"><span class="style5">
<input name="userName"
type="text"
id="UserPass4"
size="20"
maxlength="15">
</span></td>
<td width="84"
height="29"
align="center"><div align="right">*密码: </div></td>
<td width="105"
align="left"><span class="style5">
<input name="UserPass"
type="password"
id="UserPass"
size="15"
maxlength="15">
</span></td>
<td width="84"
align="center"><div align="right">*确认密码: </div></td>
<td width="146"
align="left"><input name="RUserPass"
type="password"
id="UserPass22"
size="16"
maxlength="15"></td>
</tr>
<tr>
<td height="23"
align="right"
valign="middle"><div align="right">*姓名: </div></td>
<td align="left"><input name="TrueName"
type="text"
id="TrueName"
size="20"
maxlength="20"></td>
<td align="center"><div align="right">性别: </div></td>
<td align="left"><select name="SEx"
size="1"
id="select2">
<option selected>男</option>
<option>女</option>
</select></td>
<td align="center"><div align="right">年龄: </div></td>
<td align="left"><input name="Age"
type="text"
id="Age"
value="1"
size="8"
maxlength="3"></td>
</tr>
<tr>
<td height="23"
align="right"
valign="middle"><div align="right">籍贯: </div></td>
<td align="left"><input name="Native"
type="text"
id="Native"
size="20"
maxlength="10"></td>
<td align="center"><div align="right">婚否: </div></td>
<td align="left"><select name="Marriage"
size="1"
id="Marriage">
<option selected>已婚</option>
<option>未婚</option>
<option>离异</option>
<option>其它</option>
</select></td>
<td align="center"><div align="right">性格:</div></td>
<td align="left"><select name="character"
size="1"
id="select5">
<option selected>外向</option>
<option>内向</option>
<option>偏外</option>
<option>偏内</option>
<option>中性</option>
</select></td>
</tr>
<tr>
<td height="18"
align="right"
valign="middle"><div align="right">行业: </div></td>
<td align="left"><input name="WorkType"
type="text"
id="WorkType"
size="20"
maxlength="20"></td>
<td align="center"><div align="right">职称:</div></td>
<td colspan="3"
align="left"><input name="Duty"
type="text"
id="Duty3"
size="44"
maxlength="20"></td>
</tr>
<tr>
<td height="71"
align="right"
valign="middle"><div align="right">爱好:</div></td>
<td colspan="5"
valign="top"><label>
<textarea name="Indvove"
cols="75"
rows="4"
id="Indvove"></textarea>
</label></td>
</tr>
<tr>
<td height="44"
align="right"
valign="middle"><div align="right">住址:</div></td>
<td colspan="5"
valign="top"><textarea name="tAddress"
cols="75"
rows="2"
id="tAddress"></textarea></td>
</tr>
</table>
<table width="100%"
border="0">
<tr>
<td width="22%"
height="63"> </td>
<td width="28%"
align="right"><input name="submit"
type="submit"
id="SubPut"
onClick="return userlogin()"
value="提交"></td>
<td width="29%"
align="left"><input name="submit"
type="submit"
id="SubRfill"
value="重填"></td>
<td width="21%"> </td>
</tr>
</table> </td>
</tr>
</table>
</form>
</body></html>
只有再点击一次提交按钮时才可以提交成功。
请问是上面原因
单元代码如下:
<%@LANGUAGE="VBSCRIPT"
CODEPAGE="936"%>
<!--#include file="Conn.asp"-->
<%
action=Request("action"
userName=trim(Request.Form("userName")
UserPass=trim(Request.Form("UserPass")
RUserPass=trim(Request.Form("RUserPass")
TrueName=trim(Request.Form("TrueName")
SEx=Request.Form("SEx"
Age=Request.Form("Age"
Native=Request.Form("Native"
Marriage=Request.Form("Marriage"
character=Request.Form("character"
WorkType=Request.Form("WorkType"
Duty=Request.Form("Duty"
Indvove=Request.Form("Indvove"
tAddress=Request.Form("tAddress"
if action ="yes"
then
set rs=Server.CreateObject("adodb.recordset"
rs.open "select * from EmpINfo ",conn,1,3
rs.addnew
rs("userName"=userName
rs("PassWord"=UserPass
rs("EmpName"=TrueName
rs("SEx"=SEx
rs("Age"=Age
rs("Native"=Native
rs("Espousal"=Marriage
rs("character"=character
rs("WorkType"=WorkType
rs("Duty"=Duty
rs("Indvlove"=Indvove
rs("Address"=tAddress
rs.update
rs.close
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html;
charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.style1 {font-size: larger;font-size: 12px}
.style4 {color: #999999;
font-size: x-large;
}
.style5 {font-family: "宋体"}
.style6 {font-size: larger;font-size: 12px}
-->
</style>
</head>
<script language="javascript">
<!--
function userlogin()
{
if (document.form1.userName.value==""{
alert("名称不能为空!"
do
cument.form1.userName.focus();
return false
}
if (document.form1.UserPass.value==""{
alert("密码不能为空!"
do
cument.form1.UserPass.focus();
return false
}
if (document.form1.UserPass.value!=document.form1.RUserPass.value){
alert("两次输入的密码不一致!"
do
cument.form1.RUserPass.focus();
return false
}
return true
}
function reset_form()
{
do
cument.form1.userName.value="";
do
cument.form1.UserPass.value="";
do
cument.form1.RUserPass.value="";
do
cument.form1.userName.focus;
}
//-->
</script>
<body>
<h1 align="center"><span class="style1"><span class="style4">
<label><strong>用户注册</strong></label>
</span> </span> </h1>
<form name="form1"
method="post"
action="?action=yes">
<table width="677"
height="372"
border="1"
align="center"
bordercolor="#9933FF">
<tr>
<td width="704"
height="353"
align="left"
valign="top"
class="style6"> <table width="100%"
height="225"
border="0">
<tr>
<td width="82"
height="29"
align="right"
valign="middle"> <div align="right">*名称:</div></td>
<td width="140"
align="left"><span class="style5">
<input name="userName"
type="text"
id="UserPass4"
size="20"
maxlength="15">
</span></td>
<td width="84"
height="29"
align="center"><div align="right">*密码: </div></td>
<td width="105"
align="left"><span class="style5">
<input name="UserPass"
type="password"
id="UserPass"
size="15"
maxlength="15">
</span></td>
<td width="84"
align="center"><div align="right">*确认密码: </div></td>
<td width="146"
align="left"><input name="RUserPass"
type="password"
id="UserPass22"
size="16"
maxlength="15"></td>
</tr>
<tr>
<td height="23"
align="right"
valign="middle"><div align="right">*姓名: </div></td>
<td align="left"><input name="TrueName"
type="text"
id="TrueName"
size="20"
maxlength="20"></td>
<td align="center"><div align="right">性别: </div></td>
<td align="left"><select name="SEx"
size="1"
id="select2">
<option selected>男</option>
<option>女</option>
</select></td>
<td align="center"><div align="right">年龄: </div></td>
<td align="left"><input name="Age"
type="text"
id="Age"
value="1"
size="8"
maxlength="3"></td>
</tr>
<tr>
<td height="23"
align="right"
valign="middle"><div align="right">籍贯: </div></td>
<td align="left"><input name="Native"
type="text"
id="Native"
size="20"
maxlength="10"></td>
<td align="center"><div align="right">婚否: </div></td>
<td align="left"><select name="Marriage"
size="1"
id="Marriage">
<option selected>已婚</option>
<option>未婚</option>
<option>离异</option>
<option>其它</option>
</select></td>
<td align="center"><div align="right">性格:</div></td>
<td align="left"><select name="character"
size="1"
id="select5">
<option selected>外向</option>
<option>内向</option>
<option>偏外</option>
<option>偏内</option>
<option>中性</option>
</select></td>
</tr>
<tr>
<td height="18"
align="right"
valign="middle"><div align="right">行业: </div></td>
<td align="left"><input name="WorkType"
type="text"
id="WorkType"
size="20"
maxlength="20"></td>
<td align="center"><div align="right">职称:</div></td>
<td colspan="3"
align="left"><input name="Duty"
type="text"
id="Duty3"
size="44"
maxlength="20"></td>
</tr>
<tr>
<td height="71"
align="right"
valign="middle"><div align="right">爱好:</div></td>
<td colspan="5"
valign="top"><label>
<textarea name="Indvove"
cols="75"
rows="4"
id="Indvove"></textarea>
</label></td>
</tr>
<tr>
<td height="44"
align="right"
valign="middle"><div align="right">住址:</div></td>
<td colspan="5"
valign="top"><textarea name="tAddress"
cols="75"
rows="2"
id="tAddress"></textarea></td>
</tr>
</table>
<table width="100%"
border="0">
<tr>
<td width="22%"
height="63"> </td>
<td width="28%"
align="right"><input name="submit"
type="submit"
id="SubPut"
onClick="return userlogin()"
value="提交"></td>
<td width="29%"
align="left"><input name="submit"
type="submit"
id="SubRfill"
value="重填"></td>
<td width="21%"> </td>
</tr>
</table> </td>
</tr>
</table>
</form>
</body></html>