help please very urgent problem - login not firing

Results 1 to 2 of 2

Thread: help please very urgent problem - login not firing

  1. #1
    Join Date
    Dec 1969

    Default help please very urgent problem - login not firing

    Can someone please take a look at my code. My problem is that I have a basic login scheme. It will not fire for my default.htm page that is a frame page comprised of 2 pages - default.htm(the shell), form.htm, and store.asp. I have tried to put the code at the top of the pages and it fires on the frames but not the default.htm. In addition it sometimes doesnt work period. Here is the code for the global.asa, login.asp & the code that goes on the top of each page to prevent backend access. Any feedback would be greatly appreciated. Here is my code:<BR><BR>global.asa<BR><BR>&#060;SCRIPT LANGUAGE=VBScript RUNAT=Server&#062;<BR> <BR>Sub Session_OnStart<BR> <BR> Set Cart = Server.CreateObject("")<BR> Cart.ConnectString = "cogc"<BR> Cart.StateTaxRate = "7%"<BR> Cart.CountryTaxRate = "7%"<BR> Session("Cart") = Cart.SaveCart<BR> Set Cart = Nothing<BR> Session("Authenticated") = 0<BR>end sub<BR> <BR>Sub Session_OnEnd<BR> <BR> Set Session("Cart") = Nothing<BR> <BR>end sub<BR> <BR>&#060;/SCRIPT&#062;<BR> <BR>login.asp<BR><BR>&#060;%<BR> Response.Buffer = True<BR> Dim Cm, RS<BR> <BR> <BR> Set Cm = Server.CreateObject("ADODB.Command")<BR> <BR> Cm.ActiveConnection = "DSN=cogcdsn"<BR> <BR> <BR> Cm.CommandText = "SELECT * FROM Admin WHERE " &_<BR> "Username=&#039" & Request.Form("Username") & "&#039 AND " &_<BR> "Password=&#039" &_<BR> Request.Form("UserPassword") & "&#039"<BR> <BR> Cm.CommandType = 1<BR> <BR> Set RS = Cm.Execute<BR> <BR> If RS.EOF Then<BR> Session("Authenticated") = 0<BR> Response.Redirect ("Login.htm")<BR> <BR> Else<BR> <BR> Session("Authenticated") = 1<BR> Response.Redirect ("default.htm")<BR> <BR> End If<BR> %&#062;<BR><BR>The code at the top of each page:<BR><BR>&#060;%<BR> If Session("Authenticated") = 0 Then<BR> response.redirect("login.htm")<BR> End if<BR>%&#062;<BR>

  2. #2
    lagerBoy Guest

    Default RE: help please very urgent problem - login not fi

    Try changing the bit that says:<BR><BR>&#060;%<BR>If Session("Authenticated") = 0 Then<BR>response.redirect("login.htm")<BR>End if<BR>%&#062;<BR><BR><BR>To:<BR><BR>&#060;%<BR>If IsEmpty(Session("Authenticated")) or Session("Authenticated") &#060;&#062; 1 Then<BR>Server.Transfer("login.htm")<BR>End if<BR>%&#062;<BR><BR>P.S. you don&#039t need to use Server.Transfer you could use Response.Redirect. Actually you could probably do a Server.Transfer("login.htm") at the end of your Session_OnStart routine<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts