Good Morning,
I am wanting to send users who have a certain email address to one page, and everyone else to another.
I am using the following script to process the login, so i think I need a loop to flush out the users.
So everyone who has '@blueresourcing.com' in their UID, gets sent to menu2.asp, and anyone else is directed to menu.asp, can anyone please help me achieve this??!,
Richard
This is the code
Life is a journey that always ends up in the place
I am wanting to send users who have a certain email address to one page, and everyone else to another.
I am using the following script to process the login, so i think I need a loop to flush out the users.
So everyone who has '@blueresourcing.com' in their UID, gets sent to menu2.asp, and anyone else is directed to menu.asp, can anyone please help me achieve this??!,
Richard
This is the code
Code:
<%@Language=VBScript%>
<%
Option Explicit
%>
<!-- METADATA TYPE="typelib"
FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<!-- #include file="Connectionstring.asp" -->
<%
' /////////////////////////////////////
' login validation script
' © Matt Millross
' [URL unfurl="true"]www.designplace.org[/URL]
' free for use as long as copyright notice left intact
' For more scripts, visit [URL unfurl="true"]www.designplace.org[/URL]
' /////////////////////////////////////
' variables
dim cnStr
dim rcSet
dim E_Mail
dim Password
dim sqlStr
'store form input into variables
E_Mail = Request.Form("E_Mail")
Password = Request.Form("password")
'create connection and recordset objects
Set cnStr = Server.CreateObject("ADODB.Connection")
Set rcSet = Server.CreateObject("ADODB.Recordset")
' defining database connection (connectionstring.asp)
cnStr.ConnectionString = "D:/Websites/richard/admin/db/users.mdb"
cnStr.Provider = "Microsoft.Jet.OLEDB.4.0"
cnStr.open
' execute sql and open as recordset
sqlStr = "Select * From tblUsers where E_Mail = '" _
& Request.Form("E_Mail") & "' and password = '" & Request.Form("password") & "'"
' Opens the returned values from the SQL as a recordset, ready for iteration by ASP
set rcSet = cnStr.Execute(sqlStr)
' validate variables against database
If (not rcSet.BOF) and (not rcSet.EOF) then
response.cookies("validated_user") = E_mail
response.write "<h1>Login successful!</h1>"
response.write "<p>Welcome " & rcSet.fields(1) & "</p>"
Response.Redirect("../menu.asp?E_Mail=" & E_Mail & "")
else
response.write "You appear to have entered incorrect details. Please go back again try again."
end if
%>
Life is a journey that always ends up in the place