判断,问题
好:)问大家一下,谢谢
<%
'定义变量
Dim strSQL
if request.QueryString("link")<>"" then
strAction="register2.asp?step=submit&link=" & request.QueryString("link")
else
strAction="register2.asp?step=submit"
end if
If Request.QueryString("step")="submit" then
strSQL="Select zhanghao from yiyatrans where zhanghao='" &Request.Form("zhanghao")&"'"
set rsSQL= Conn.Execute(strSQL)
If NOT rsSQL.EOF Then
if Request.QueryString("link")="" then
strLink="register2.asp?step=again"
else
strLink="register2.asp?step=again&link=" & request.QueryString("link")
end if
Response.Redirect strLink
else
strmax="select Max(id) as themax from yiyatrans"
set rsmax=Conn.Execute(strmax)
if isnull(rsmax("themax")) then max=1 else max=rsmax("themax")+1
session("zhanghao")=request.Form("zhanghao")
session("password1")=request.Form("password1")
if Request.QueryString("link")="" then
strLink="register3.asp?userid="&max
else
strLink="register3.asp?userid="& max & "&link=" & request.QueryString("link")
end if
Response.Redirect strLink
End if
End If
%>
我用这段做会员的,判断,就是,如果有重复的会员,就不能加入数据库了,但是,如是没有重复的会员,我就加入。但是这个程序,不是重复的会员,加入数据库他的值是空的,,就是有生成一个,ID但是没有数据,数据为空,但是,我去掉这一值,提交就可以有值,也就是说,我不判断,就可以加入数据库,而且有数据。上面这一段是否有写错?这里好发像有一些是没用到的?您帮我看看