Visualizzazione dei risultati da 1 a 5 su 5

Discussione: accesso in remoto

  1. #1

    accesso in remoto

    Un mio amico vorrebbe farmi accedere in remoto per farmi vedere i propri siti in asp. Mi da l'ip ed il link ma mi chiede di inserire utente, pass e dominio.

    Come fare per avere i permessi?

    Dove si configura il tutto in windows xp professional?
    L'importante è partecipare

  2. #2

  3. #3

    grazie

    se tu fossi femmina ti sposerei.

    Per il quesito sull'http referreil potresti essere più chiaro?
    L'importante è partecipare

  4. #4
    La pagina che fa il login prende anche il REFERER ovvero intercetta l'indirizzo di provenienza e dopo aver fatto il login rimanda all'indirizzo di provenienza.
    Tutte le pagine per eseguire il login puntano alla pagina login.asp.
    La login.asp dopo aver controllato che username e password siano corrette ed aver autenticato l'utente fa un:
    codice:
    <%
    Response.Redirect Request.ServerVariables("HTTP_REFERER") 
    %>
    Request.ServerVariables("HTTP_REFERER") restituisce l'indirizzo di provenienza.

  5. #5

    esempio specifico

    La pagina del form per il login è:

    [blue]
    <form name="signin" action="signin.asp" method="post">
    <font size="2" face="arial,helvetica">
    <input type="hidden" name="page" value="<%=Request.QueryString("page")%>">
    </font>
    <table width=215 border=0 align="center" cellpadding=4 cellspacing=1
    bgcolor=#eeeeee>
    <tbody>
    <tr>
    <td> <table cellspacing=1 cellpadding=0 width=215
    border=0>
    <tbody>
    <tr bgcolor=#ffffff>
    <td class=body><table width="420" cellpadding=0 cellspacing=0 align="center" border=0>
    <tr>
    <th class="lineadown"><font face="arial,helvetica" size=3>Entra</font></th>
    <th class="lineadown"><font face="arial,helvetica" size=3>Registrami</font></th>
    </tr>
    <tr>
    <td align="center"> <font size=2 face="arial,helvetica">
    Username :
    <input type="text" name="username" size="12" style="font-family: tahoma,verdana, Arial, Helvetica, sans-serif;">


    Password :
    <input type="password" name="password" size="12" style="font-family: tahoma,verdana, Arial, Helvetica, sans-serif;">


    Ricorda :
    <input type="checkbox" name="stayloggedin" value="yes">


    <input name="submit" type="submit" style="font-family: tahoma,verdana, Arial, Helvetica, sans-serif;" value="Entra">
    </font> </td>
    <td align="center"> <font size=2 face="arial,helvetica">
    <a href="signupform.asp">Non sono utente del
    sito.... registrami!
    </a> </font> </td>
    </tr>
    </table></td>
    </tr>
    </tbody>
    </table></td>
    </tr>
    </tbody>
    </table>
    </form>
    [/blue]

    poi la pagina che elabora i dati è:

    [blue]
    <%
    Option Explicit
    Dim sql,rsUser,username,password,page,stayloggedin,LCo nnectString,lconn,sqlflag

    'Grab the submitted variables (page is the page they've come from, set by the hidden variable at the login box)
    username = Request.Form("username")
    password = Request.Form("password")
    page = Request.Form("page")
    stayloggedin = Request.Form("stayloggedin")

    if page = "" then
    page = "index.asp"
    end if

    'Check no s**t is trying to hack in using SQL commands
    if InStr(username, "'") or InStr(username, """") or InStr(username, "=") or InStr(password, "'") or InStr(password, """") or InStr(password, "=") then
    sqlflag = True
    end if

    'Open connection
    %>

    <%

    'Get a recordset corresponding to the submitted username and password
    sql = "SELECT username FROM users WHERE username = '" & username & "' AND password = '" & password & "'"
    Set rsUser = Server.CreateObject("ADODB.Recordset")
    rsUser.Open sql, conn, 3, 3

    'If there was a valid recordset there, then send them back to the page they came from, with the username cookie set
    If (not rsUser.BOF) and (not rsUser.EOF) and sqlflag <> True then
    Response.Cookies("username") = rsUser("username")
    'If the user wants to stay logged in all the time, then we'll set the cookie with a far-away expiry date
    if stayloggedin = "yes" then
    Response.Cookies("username").expires = #1/1/2010#
    end if
    rsUser.close
    set rsUser = nothing
    conn.close
    set conn = nothing
    Response.Redirect(page)
    end if

    rsUser.close
    set rsUser = nothing
    conn.close
    set conn = nothing%>
    [/blue]

    Credo che il nodo sia nella variabile Page ed inserimento del referer ma come?


    Abbi pazienza sono una frana in asp
    L'importante è partecipare

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 © 2026 vBulletin Solutions, Inc. All rights reserved.