Forums

ASP

This topic is locked

NEW PROBLEM - old one semi-solved

Posted 26 Sep 2001 20:27:43
1
has voted
26 Sep 2001 20:27:43 Samantha Jones posted:
ok...i have finally got to a certain point, and i am stuck...AGAIN!

I am writing a (or at least trying to) write a redirect script for a number of users once they login - each user going to a seperate URL. I have only one problem...it doesn't work unless I put in one of the usernames as a default value, and then, as you can imagine, all the logins go to the defaults URL. Is there something that i am missing???

Here's the code below:

<%
Dim Recordset1__varLogin
Recordset1__varLogin = "esb"
if (Session("MM_valUsername"<> "" then Recordset1__varLogin = Session("MM_valUsername"
%>
<%
Dim Recordset1__varPass
Recordset1__varPass = "esb"
if (Session("UserPass"<> "" then Recordset1__varPass = Session("UserPass"
%>
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset"
Recordset1.ActiveConnection = MM_knet2_STRING
Recordset1.Source = "SELECT accessLevel, companyName, privName, privID FROM priv WHERE login = '" + Replace(Recordset1__varLogin, "'", "''" + "' AND password = '" + Replace(Recordset1__varPass, "'", "''" + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Session("Name" = TRIM(Recordset1.Fields.Item("privName".Value)
Response.Cookies("access" = TRIM(Recordset1.Fields.Item("accessLevel".Value)
Session("company" = TRIM(Recordset1.Fields.Item("companyName".Value)
Response.Cookies("cLogin" = Recordset1.Fields.Item("privName".Value
Session("ID" = TRIM(Recordset1.Fields.Item("privID".Value)
%>
<html>
<head>
<title>Redirection</title>
<% if Recordset1.Fields.Item("accessLevel".Value = "esb" then %>
<meta http-equiv="Refresh" content="0; URL=www.printchannel.com/cgi-bin/xat/ELECTRICITYSB %>">
<% END IF %>

</head>
<body bgcolor="#FFFFFF" text="#000000">
<% IF Trim(Request.Cookies("access") = "esb" THEN %>
<% Response.Redirect("www.printchannel.com/cgi-bin/xat/ELECTRICITYSB") %>
<% END IF %>
<% IF Trim(Request.Cookies("access") = "mercer" THEN %>
<% Response.Redirect("www.printchannel.com/cgi-bin/xat/MERCER") %>
<% END IF %>
<% IF Trim(Request.Cookies("access") = "vhi" THEN %>
<% Response.Redirect("www.printchannel.com/cgi-bin/xat/VHI") %>
<% END IF %>
<br>
<%= Request.Cookies("cLogin" %> <%= Request.Cookies("access"%>
</body>
</html>
<%
Recordset1.Close()
%>

I am just about at the end of my tether with this one! If there is help out there...please provide it!

Ta

Sam

Reply to this topic