Portal 个性登录页

Windows集成验证的登录甚是老土,想改变么,现在就开始!
None.gif < form  name =login   method =post  ID ="Form1" >
None.gif     
< table  width ="100%"   border ="0"  cellspacing ="0"  cellpadding ="0"  ID ="Table2" >
None.gif            
< tr >
None.gif               
< td >
None.gif                
< input  type ="hidden"  name ="domain"  value ="chy\"  size =16   maxLength =16  ID ="Hidden1" >  
None.gif                用户名:
< input  type ="text"  name ="name"  size ="10"  ID ="Text1" ></ td >
None.gif              
</ tr >
None.gif              
< tr >
None.gif                
< td > 密码: < input  type ="password"  name ="pwd"  size ="10"  ID ="Password1" ></ td >
None.gif              
</ tr >
None.gif              
< tr >
None.gif                
< td >< div  align ="center" >< href ="#" >< img  src ="images/login2.jpg"  border ="0"  onclick ="javascript:plogin_onclick()" ></ a ></ div ></ td >
None.gif              
</ tr >
None.gif          
</ table >  
None.gif
</ form >
ExpandedBlockStart.gifContractedBlock.gif
< script  language ="javascript" > dot.gif
InBlock.gif
<!-- 
InBlock.gif
function plogin_onclick() 
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif  
var username = login.name.value;
InBlock.gif  
var domain = login.domain.value;  
InBlock.gif  
var name = domain+username;
InBlock.gif  
var password = login.pwd.value;
InBlock.gif  
if(username.length == 0)
ExpandedSubBlockStart.gifContractedSubBlock.gif  
dot.gif{
InBlock.gif      alert(
"请您输入用户名!");
InBlock.gif      
return;
ExpandedSubBlockEnd.gif  }

InBlock.gif  
var Location = "http://portal:8002";
InBlock.gif  
var auth = new ActiveXObject("msxml2.xmlhttp");     //创建msxml2.xmlhttp对象
InBlock.gif
  auth.open("get", Location, false, name, password );
InBlock.gif  
//auth的open方法,用HTML页面里的login form里的name和pwd 以及Location作为参数
InBlock.gif
  try
ExpandedSubBlockStart.gifContractedSubBlock.gif  
dot.gif{
InBlock.gif    auth.send();
ExpandedSubBlockEnd.gif  }

InBlock.gif  
catch(e)
ExpandedSubBlockStart.gifContractedSubBlock.gif  
dot.gif{
InBlock.gif    alert(
"对不起,服务器发生错误,请稍后再试");
InBlock.gif    
return;
ExpandedSubBlockEnd.gif  }
 
InBlock.gif  
if(auth.status == 200)
ExpandedSubBlockStart.gifContractedSubBlock.gif  
dot.gif{
InBlock.gif    window.location.href 
= "http://portal:8002";
InBlock.gif    
return true;
ExpandedSubBlockEnd.gif  }

InBlock.gif  
else if(auth.status == 401)
ExpandedSubBlockStart.gifContractedSubBlock.gif  
dot.gif{
InBlock.gif      alert(
"用户无效或密码错误");
InBlock.gif    
return false;
ExpandedSubBlockEnd.gif  }

InBlock.gif  
else
ExpandedSubBlockStart.gifContractedSubBlock.gif  
dot.gif{
InBlock.gif      alert(
"对不起,服务器发生错误,请稍后再试");
InBlock.gif    
return false;
ExpandedSubBlockEnd.gif  }

ExpandedSubBlockEnd.gif  }

ExpandedBlockEnd.gif
-->
None.gif
</ script >

转载于:https://www.cnblogs.com/an_andy/archive/2006/04/03/365843.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值