<%
msg = ""
reason = trim(lcase(request("reason")))
select case reason
case "expire"
msg = "Session expired.Please relogin"
case "pwd_change"
msg = "Password changed successfully!!! Please login again to continue"
end select
if Request.ServerVariables("REQUEST_METHOD") = "POST" then
login_failed = "false"
clogin = replace(replace(request.form("txtname"),"'","''"),"""","""""")
cPassword = replace(replace(request.form("txtpass"),"'","''"),"""","""""")
'query = "select * from admin where clogin= '" & clogin & "' and cpassword = '" & cPassword &"'"
'response.Write(query)
'response.End()
set rs_con = Conn.Execute ("select * from admin where clogin= '" & clogin & "' and cpassword = '" & cpassword &"'")
if not (rs_con.eof) then
'response.write(len(rs_con("cpassword")))
'response.write(len(cpassword))
'response.end()
if trim(rs_con("cpassword")) = cpassword then
'session("ADMIN") = rs_con("cFname") + " " + rs_con("cLname")
session("loginid") = rs_con("cLogin")
Response.Redirect("studentmain.asp")
else
msg = "Invalid login Id or Password"
end if
else
login_failed = "true"
session("LOGINED")=false
msg = "Invalid login Id or Password"
end if
end if
%>