新人,域验证后如何到指定页面
偶从CSDN上找了一段域验证代码,可以用,但不知道如何验证后如何跳转页面。
他返回为
response.write "True "
else
response.write "False "
偶加连接就提示错误,请帮助下,谢谢。
A.ASP:
<form action= "b.asp " method= "post ">
域用户: <input type=text name=id> <br/>
域密码: <input type=text name=pwd> <br/>
登陆域: <input type=text name=domain> <br/>
<input name=sub type=submit value= "提交 ">
</form>
B.ASP:
<script language=javascript RUNAT= "SERVER ">
function logonDoADLogon(p_strDomain, p_strUserID, p_strPWD)
{ //return true;
var f_oIADS, f_oUser, f_oContainer;
var f_blnRet = true;
try
{
var f_oIADS = GetObject( 'WinNT: ');
f_oContainer = f_oIADS.OpenDSObject( 'WinNT:// ' + p_strDomain, p_strDomain + "\\ " + p_strUserID, p_strPWD, 0);
delete f_oContainer;
delete f_oIADS;
}
catch (e)
{
return false;
}
try
{
var objUser = GetObject( "WinNT:// " + p_strDomain + "/ " + p_strUserID );
delete objUser;
}
catch(e){
return false;
}
return true;
}
</script>
<%
id=trim(request( "id "))
pwd=trim(request( "pwd "))
domain=trim(request( "domain "))
if logonDoADLogon(domain,id,pwd) then
response.write "True "
else
response.write "False "
end if
%>
------解决方案--------------------if logonDoADLogon(domain,id,pwd) then
response.redirect( "a.asp ")
else
response.redirect( "b.asp ")
end if