Originariamente inviato da X_Gold*
forse la session è scaduta o comunque vuota ?
non credo, questa è la pagina di login:
codice:
sSql = "Select id,Username,Password,Email,Firstname,Lastname,Joindate,Logintimes FROM Users Where Username = '" & Username & "'"
Set oRS = oConn.Execute(sSql)
If oRS.eof then
usererror = "2"
Else
If Lcase(oRS("Password")) = Lcase(Password) Then
Session("Username") = oRS("Username")
Session("Password") = oRS("Password")
Session("Email") = oRS("Email")
Session("Firstname") = oRS("Firstname")
Session("Lastname") = oRS("Lastname")
Session("Joindate") = oRS("Joindate")
Logintimes = oRS("LoginTimes") + 1
Session("utente") = Request("Username")
if InStr(1, Application("Utente"), Session("utente") & "#^#" & oRS("id") &"|" ) = 0 then
Application.Lock
Application("Utente") = Application("Utente") & Session("utente") & "#^#" & oRS("id") & "|"
Application.UnLock
end if
Set oRS = nothing
sSQL = "Update Users SET Logintimes='" & LoginTimes & "' where Username='" & Session("Username") & "'"
Set oRS = oConn.Execute(sSQL)
oConn.Close
Set oRS = Nothing
Set oConn = Nothing
questa è la pagina con cui recupero la lista utenti:
codice:
Nome = session("utente")
response.write nome &"
"
id = session("id")
response.write id &"
"
Dim Conn, SQL, Rec
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="& server.MapPath("/mdb-database/Whole.mdb")
SQL = "SELECT * FROM users where id = "& id
response.write sql &"
"
Set rec = Server.CreateObject("ADODB.Recordset")
Set Rec=Conn.Execute(SQL)
Dim arrUtenti, i
Response.Write "<font color=blue size=1 font face=verdana>In Linea: </font>"
arrUtenti = Split(Application("Utente"),"|")
dim utenti
for i = 0 to UBound(arrUtenti)-1
if i <> UBound(arrUtenti)-1 then
response.write ("<font color=red size=1 font face=verdana>"&replace(arrUtenti(i), "#^#", " ")&", </font>")
else
response.write ("<font color=red size=1 font face=verdana>"& replace(arrUtenti(i), "#^#", " ")&"</font>")
end if
Next