Visualizzazione dei risultati da 1 a 4 su 4

Discussione: Un URL per ogni utente

  1. #1

    Un URL per ogni utente

    Ciao a tutti.
    Ho un DB semplicissimo con id,user, password, url.
    Devo fare in modo che dopo essersi logato ogni utente vada all'url crrispondente.. come devo fare?
    Qui c'è il codice che sto usando, al momento direziona tutti gli utenti allo stesso url, ossia il primo del DB...

    Grazie a tutti


    codice:
    <%
    Dim rs_utenti
    Dim rs_utenti_numRows
    
    Set rs_utenti = Server.CreateObject("ADODB.Recordset")
    rs_utenti.ActiveConnection = MM_conn_db_scuole_STRING
    rs_utenti.Source = "SELECT * FROM utenti"
    rs_utenti.CursorType = 0
    rs_utenti.CursorLocation = 2
    rs_utenti.LockType = 1
    rs_utenti.Open()
    
    rs_utenti_numRows = 0
    %>
    <%
    url=(rs_utenti.Fields.Item("url").Value)
    Response.Write(url)
    %>
    <%
    ' *** Validate request to log in to this site.
    MM_LoginAction = Request.ServerVariables("URL")
    If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
    MM_valUsername=CStr(Request.Form("user"))
    If MM_valUsername <> "" Then
      MM_fldUserAuthorization=""
      MM_redirectLoginSuccess=""& url &""
      MM_redirectLoginFailed="ko.asp"
      MM_flag="ADODB.Recordset"
      set MM_rsUser = Server.CreateObject(MM_flag)
      MM_rsUser.ActiveConnection = MM_conn_db_scuole_STRING
      MM_rsUser.Source = "SELECT user, password"
      If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
      MM_rsUser.Source = MM_rsUser.Source & " FROM utenti WHERE user='" & Replace(MM_valUsername,"'","''") &"' AND password='" & Replace(Request.Form("password"),"'","''") & "'"
      MM_rsUser.CursorType = 0
      MM_rsUser.CursorLocation = 2
      MM_rsUser.LockType = 3
      MM_rsUser.Open
      If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then 
        ' username and password match - this is a valid user
        Session("MM_Username") = MM_valUsername
        If (MM_fldUserAuthorization <> "") Then
          Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
        Else
          Session("MM_UserAuthorization") = ""
        End If
        if CStr(Request.QueryString("accessdenied")) <> "" And false Then
          MM_redirectLoginSuccess = Request.QueryString("accessdenied")
        End If
        MM_rsUser.Close
        Response.Redirect(MM_redirectLoginSuccess)
      End If
      MM_rsUser.Close
      Response.Redirect(MM_redirectLoginFailed)
    End If
    %>
    Ho capito che quando poni una domanda e nessuno ti sa rispondere, è arrivato il momento in cui sei tu a poter dare delle risposte agli altri...

  2. #2
    Utente di HTML.it L'avatar di mexican
    Registrato dal
    Oct 2001
    residenza
    cava de tirreni
    Messaggi
    3,541

    :O

    Beh ma è tutto fatto con dreamweaver :O!!!Non si capisce nulla

  3. #3
    purtroppo scriverlo da zero, da solo, non riesco.
    Ho capito che quando poni una domanda e nessuno ti sa rispondere, è arrivato il momento in cui sei tu a poter dare delle risposte agli altri...

  4. #4
    Utente di HTML.it L'avatar di mexican
    Registrato dal
    Oct 2001
    residenza
    cava de tirreni
    Messaggi
    3,541

    cmq doveresti fare

    strsql="Select * From Tabella where user=" & request.form("campo") & " and password=" & request.form("campo")

    if rs.eof then

    poi vedi se li trova

    response.redirect("rs("tua_url")")

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.