Password/Username and Redirect

Results 1 to 4 of 4

Thread: Password/Username and Redirect

  1. #1
    Abe Billings Guest

    Default Password/Username and Redirect

    I would like to create a password scheme whereby individuals are redirected to appropriate areas of their website based on their authorized &#039;access area.&#039;<BR><BR>I have created the database with the username, password, and access area fields but am having a problem with the redirect code. <BR><BR>What would be the best way to approach this requirement? If...then Else or Case...? Does anyone have some code to show me how I should approach this?<BR><BR>Thanks<BR><BR>Abe

  2. #2
    Join Date
    Dec 1969

    Default Not advanced

    paste your code in asp forum

  3. #3
    Abe Billings Guest

    Default RE: Not advanced

    Okay. I&#039;ve done that...<BR><BR>Anyone like to help me with an answer...?<BR><BR>Thanks

  4. #4
    Join Date
    Dec 1969

    Default RE: Password/Username and Redirect

    Set cn = server.createobject("adodb.connection")<BR>Set rs = server.createobject("adodb.recordset")<BR>SQL = "SELECT [acess area field] FROM [your table] WHERE username=&#039;" & username & "&#039; AND password=&#039;" & password & "&#039; "<BR> myconnectionstring<BR> SQL,cn,0,1<BR>If rs.EOF Then<BR>&#039;REDIRECT TO LOGIN ERROR PAGE<BR>response.redirect "error.asp"<BR>Else<BR>response.redirect rs.fields.item("acess area field").value<BR>End If<BR><BR>If the value in [acess area field] is an idenetify not a page then you will have to use a Select Case in the Else portion of the above conditional statement like:<BR><BR>Select Case rs.fields.item("acess area field").value<BR>case "1"<BR>response.redirect "here.asp"<BR>case "2"<BR>response.redirect "there.asp"<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