% ' this is the section where the defaults are set ' copy this to the bban.asp for the javascript and click stuff dim dbpath,U Dim connection,userid,password,mess,conn,CONFIRMPSW mess="" IF IsEmpty(Request("userid")) or IsEmpty(Request("PASSWORD")) THEN userid="" mess="" CONFIRMPSW="" ELSE userid=ucase(Request("USERID")) PASSWORD=ucase(Request("PASSWORD")) CONFIRMPSW=ucase(Request("CONFIRMPSW")) 'mess=userid & ":" & password & ":" & CONFIRMPSW call opendb(conn) dim strSQL,RS strSQL = "SELECT * from USR where UCASE(userid)='" & userid & "'" Set RS = Conn.Execute(strSQL) if rs.eof and rs.bof then mess=mess & " Error logging in, password or id not correct, try again" 'it might be a new login if trim(CONFIRMPSW)<>"" then strSQL="INSERT into USR (USERID,PSW) values ('" & userid & "','" & password & "')" Conn.Execute(strSQL) rs.close session("userid")=userid session("password")=password conn.close set conn=nothing response.redirect("contact.asp") else if userid = "KPGRAHAM" and PASSWORD="PENCIL" then conn.close set rs=nothing set conn=nothing session("userid")=userid session("password")=password response.redirect("adminads.asp") end if end if else rs.movefirst if rs("PSW")<>password then mess=mess & " Error logging in, password or id not correct, try again" else ' have match rs.close conn.close set rs=nothing set conn=nothing session("userid")=userid session("password")=password response.redirect("sprofile.asp") end if end if rs.close conn.close set rs=nothing set conn=nothing END IF password="" %>