I need to enable my login function to read data from 2 different tables in my database, the discussion forum table and the customer table. Right now, visitors can only login as customers because the login function is setup to read from the customer table, and not both of the tables.
I had a few website developers do the site for me, so I have tried to learn some javascript tutorials; I have learned the basics, but I cannot seem to figure out how to do this. I think it has to do with an “or” function or “if, then” statement.
How can I set it up so that the username and password can be read from either of the tables?
The current setup is listed below:
<%
success=2
if request(“logout”)<>”logout” then
rs.open “Select * from tblusers where username ='” & request(“txtUsername”) & “‘ and userpassword='” & request(“txtPassword”) & “‘”,con,1,3
‘rs.open “Select
‘response.write “Select * from tblusers where username ='” & request(“txtUsername”) & “‘ and userpassword='” & request(“txtPassword”) & “‘ and userdate=” or userdate<=’#” & date() & “#'”
‘response.end
if not(rs.eof or rs.bof) then
success=1
session(“userid”)=rs(“userid”)
session(“username”)=rs(“username”)
session(“fpswd”)= request(“txtPassword”)
response.redirect “welcome.asp”
Else
session(“username”)=””
success=0
Call ClearCookies()
session.Abandon()
End if
rs.close
End if
%>
How can I make th login function read from tblForum_Members, under the columns M_username and M_password?
Thank you,
Jerome