password login redirect

Results 1 to 2 of 2

Thread: password login redirect

  1. #1
    Join Date
    Dec 1969

    Default password login redirect

    i have a login script that works from an access database. This all works fine however when the user logs on he/she is passed to the default page is there a way i can point the user to a specific page using the username. the code i have is below<BR><BR>&#060;%@ LANGUAGE="VBSCRIPT" %&#062;<BR><BR>&#060;%<BR><BR>Dim oCONv, oRSu<BR> Set oCONv = Server.CreateObject("ADODB.Connection")<BR>dbPath = "d:/inetpub/fp01-431/fpdb/VAULT.mdb;"<BR>oConv.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & dbPath <BR><BR><BR>if Session("UserID") = "" or Request.Form("UserID") &#060;&#062; "" then<BR> Session("UserID") = ""<BR><BR> Set oRSu = oCONv.Execute("SELECT tblUsers.UserID, tblUsers.Password " & _<BR> "FROM tblUsers " & _<BR> "WHERE UserID = &#039;" & Request.Form("UserID") & _<BR> "&#039; AND Password = &#039;" & Request.Form("Password") &_<BR> "&#039; AND Date()-32&#060;tblUsers.DateSold") <BR><BR> if not oRSu.EOF then<BR> Session("UserID") = oRSu ("UserID")<BR> Response.Redirect "view.asp" <BR> else<BR> Response.Redirect "sorry.htm"<BR> end if<BR>end if<BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: password login redirect

    Why not create a page field in your login table that holds their default start page. Or possibly create a cookie that will hold this. Then when they successfully log in, pull that info from either the table or the cookie and put it in something like this.<BR><BR>page = request.cookies("page") <BR>response.redirect page<BR><BR>this assumes that page holds the value of something like "homepage.asp" or something like that.

Posting Permissions

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