Al limite potresti fare questo.
Modifica il file login.asp così:
codice:
<%
Dim nome_ut
Dim pass
nome_ut = Replace(Request.Form("nome_utente"), "'", "''")
pass = Replace(Request.Form("password"), "'", "''")
Dim cn
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&Server.MapPath("utenti.mdb")
Dim sql
sql = "SELECT ID FROM Utenti WHERE NOMEUTENTE='" &nome_ut&_
"' AND PASSWORD='" &pass& "'"
Dim rs
Set rs = cn.Execute(sql)
Dim autenticato
if rs.eof then
autenticato = false
else
autenticato = true
id_utente = rs(0)
end if
if autenticato = true then
Session("Autenticato") = "OK"
%>
">entra nell'area riservata
<%
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
else
Response.Redirect("index.asp")
end if
%>
e il file riservato.asp così:
codice:
<%
if Session("Autenticato")<>"OK" then
Response.Redirect("index.asp")
end if
%>
<%
set conn = server.createobject("adodb.connection")
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=" & server.mappath("utenti.mdb")
conn.Open DSNtemp
%>
<%
cod=Request.Querystring("cod")
SQL="SELECT * FROM utenti WHERE id="&cod
Set rec = Server.CreateObject("ADODB.Recordset")
Set rec =Conn.Execute(SQL)
%>
<HTML>
<HEAD>
<TITLE>Area riservata</TITLE>
</HEAD>
<BODY BGCOLOR=#BBBBFF>
<%=rec ("testo")%>
<DIV ALIGN=CENTER><H1>PAGINA RISERVATA</H1>
<H2>UTENTE AUTENTICATO</H2>
</DIV>
</BODY>
</HTML>
Non è quello che si dice il massimo, ma per capire come si passano le variabili può esserti utile e in sostanza dovrebbe fare pressapoco quello che volevi