<!--#include file="../conn/admin_dbconn.inc" -->
<%

         userUserId=Request.Cookies("hl_user")("username")
		 userPassword=Request.Cookies("hl_user")("password")
if userUserId="" or userPassword="" then
	  response.write"<SCRIPT language=JavaScript>alert('请先登陆会员中心');"
	  response.write"this.location.href='User_Login.asp'</SCRIPT>" 
      response.end
end if
if session("hl_user")<>"hl_user_center" then
	  response.write"<SCRIPT language=JavaScript>alert('请先登陆会员中心');"
	  response.write"this.location.href='User_Login.asp'</SCRIPT>" 
      response.end
end if

sql_user="select * from hl_user where username='" & userUserId & "'"  '-----用户名检测
set rs_user= Server.CreateObject("ADODB.Recordset") 
rs_user.open sql_user,conn_admin,1,1
if not(rs_user.bof and rs_user.eof) then
    TempPassword=rs_user("userpassword")
	If Len(rs_user("userpassword"))=32 Then TempPassword=Mid(rs_user("userpassword"),9,16)'判断数据库密码是否为32位，是则将密码转为16位 
    if TempPassword<>userPassword then
	 	  response.write"<SCRIPT language=JavaScript>alert('请先登陆会员中心');"
	      response.write"this.location.href='User_Login.asp'</SCRIPT>" 
          response.end
     end if
	 rs_user.close
	 set rs_user=nothing
	 conn_user.close
     set conn_user=nothing
else
	response.write"<SCRIPT language=JavaScript>alert('请先登陆会员中心');"
	response.write"this.location.href='User_Login.asp'</SCRIPT>" 
	response.end
	rs_user.close
	set rs_user=nothing
	conn_user.close
set conn_user=nothing
end if

%>