下面两个函数是一个chklogin是asp判断用户登录而dologin是用户处理用户登录的函数 <script>ec(2);</script> function chkLogin(b){ iSiteId = 1 /* if(isNaN(iSiteId)||iSiteId<1){ // not logined if(b){ // do login if(doLogin()) return true; else doAlert("","Login.asp?innerUrl=" sUrl); }else{ iSiteId = 0; return false; } }else{ return true; } */ isNaN(iSiteId); //doLogin(); return true; } /* function doLogin(){ var sUID = Str4Sql(Request("UID") ""); var sPWD = Str4Sql(Request("PWD") ""); var sInnerUrl = Str4Sql(Request("innerUrl") ""); if(sUID.length<1||sUID=="undefined") return false; sSqlString = "select SiteId,pwd,SiteOpen from t_Site where UID='" sUID "'"; var oRs = oConn.execute(sSqlString); if(oRs.EOF) doAlert("用户不存在","Login.asp?innerUrl=" sUrl); else if(sPWD!=oRs.fields.item(1).value&&oRs.fields.item(2).value<1) doAlert("密码错误","Login.asp"); iSiteId = oRs.fields.item(0).value; Session("cc_count_6_site_id") = iSiteId; if(sInnerUrl&&sInnerUrl!="undefined") doAlert("",sInnerUrl); //else doAlert("","Login.asp"); return true; }
|