<%set conn=server.createobject("adodb.connection")
Conn.Open "provider=SQLOLEDB;Server=ANT111;Database=aaa;UID=wendy;PWD=0125;"
sql="select * from zc" %>
<%set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
dim yhm,mm,name,tel,xb
yhm=request.Form("yhm")
mm=request.Form("mm")
name=request.Form("name")
tel=request.Form("tel")
xb=request.Form("xb")
if rs.eof then
rs.addnew
rs("yhm")=yhm
rs("mm")=mm
rs("name")=name
rs("tel")=tel
rs("xb")=xb
rs.update
rs.close
conn.close
set rs=nothing
set rs=nothing
end if
%>
<html>
<body>
<table>
<tr>
<h1 align=center>注册</h1></tr>
<tr>
<form name="zcform" method="post" action="ip.asp">
<p>用户名:
<input name="yhm" id="yhm">
</p>
<p> 密码:
<input name="mm" id="mm" type="password">
</p>
<p>密码确认:
<input name="mmqr" id="mmqr" type="password">
</p>
<p>姓名:
<input name="name" id="name">
</p>
<p>性别:
<input name="xb" id="xb1" type=radio>
男
<input name="xb" id="xb2" type=radio>
女<br>
电话:
<input name="tel" id="tel">
</p>
<p align="center"> <input name="提交" type="submit" value="提交" align="middle" >
</p>
</form>
</tr>
</tr>
</body>
</html>
Conn.Open "provider=SQLOLEDB;Server=ANT111;Database=aaa;UID=wendy;PWD=0125;"
sql="select * from zc" %>
<%set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
dim yhm,mm,name,tel,xb
yhm=request.Form("yhm")
mm=request.Form("mm")
name=request.Form("name")
tel=request.Form("tel")
xb=request.Form("xb")
if rs.eof then
rs.addnew
rs("yhm")=yhm
rs("mm")=mm
rs("name")=name
rs("tel")=tel
rs("xb")=xb
rs.update
rs.close
conn.close
set rs=nothing
set rs=nothing
end if
%>
<html>
<body>
<table>
<tr>
<h1 align=center>注册</h1></tr>
<tr>
<form name="zcform" method="post" action="ip.asp">
<p>用户名:
<input name="yhm" id="yhm">
</p>
<p> 密码:
<input name="mm" id="mm" type="password">
</p>
<p>密码确认:
<input name="mmqr" id="mmqr" type="password">
</p>
<p>姓名:
<input name="name" id="name">
</p>
<p>性别:
<input name="xb" id="xb1" type=radio>
男
<input name="xb" id="xb2" type=radio>
女<br>
电话:
<input name="tel" id="tel">
</p>
<p align="center"> <input name="提交" type="submit" value="提交" align="middle" >
</p>
</form>
</tr>
</tr>
</body>
</html>