asp 代码 有错误吗?

来源:百度知道 编辑:UC知道 时间:2024/06/04 01:09:43
<%dim user_name,user_email
user_name=trim(request("u_name"))
user_email=trim(request("u_email"))
response.Write(user_name)
response.Write(user_imail)
if user_name="" then
response.Write("用户名不能为空")
set rs=nothing
response.End()
'response.Redirect("index.asp")
elseif user_email="" then
response.Write("email不能为空")
set rs=nothing
response.End()
response.Redirect("index.asp")
elseif user_email.value.indexof("@")<0 or user_email.value.indexof(".")<0 then
response.Write("邮箱格式不正确")
response.Redirect("index.asp")
else
rs.addnew
rs("name")=user_name
rs("email")=user_email
rs.update
response.Redirect("index.asp")
end if
%>
提示“EMAIL”缺少对象

<%dim user_name,user_email
user_name=trim(request("u_name"))
user_email=trim(request("u_email"))
response.Write(user_name)
response.Write(user_imail)

if user_name="" then
response.Write("用户名不能为空")
response.End()
'set rs=nothing
'response.Redirect("index.asp")
end if
if user_email="" then
response.Write("email不能为空")
response.End()
'set rs=nothing
response.Redirect("index.asp")
end if
if user_email.value.indexof("@")<0 or user_email.value.indexof(".")<0 then
response.Write("邮箱格式不正确")
response.End()
' response.Redirect("index.asp")
end if
rs.addnew
rs("name")=user_name
rs("email")=user_email
rs.update
response.Redirect("index.asp")
end if