Avatar billede guzzie Nybegynder
07. maj 2001 - 12:59 Der er 1 kommentar og
1 løsning

list of online users and there email

Hey Experts

I found an old example of a mini chat that I have removed the \"online users\" application from and inserted it into a login system I have
when a person logs in i create three sessions
name, email and password
at the same time it creates a list of logged online users by using the session name
My problem is this
I have been trying to create a new list that will show that persons email aswell but I only get server errors :(
Any ideas ? heres my script

page1 <--- creates the list of users when logging in

<%
  Dim users

  If Application(\"NumUsers\") = 0 Then
      ReDim temp1(50)
      ReDim temp2(50)
      Application(\"users\") = temp1
  End If

  users = Application(\"users\")

  Dim i
  For i = 1 To 1000
      If users(i) = \"\" Then
          users(i) = Session(\"name\")
          Application.Lock
          Application(\"NumUsers\") = Application(\"NumUsers\") + 1
          Application.Unlock
          Exit For
      End If
  Next

  Application.Lock
  Application(\"users\") = users
  Application.Unlock


  Response.Redirect \"users.asp\"
%>

Page 2 <--- show the list of onlineuser
(but with for there emails as well)
<%
Dim Userlist, Datelist, i, num, users, refresh

\' Retrieve application arrays
users = Application(\"users\")
refresh = Application(\"refresh\")

For i = 1 To 50
  If users(i) = Session(\"name\") Then
      refresh(i) = Time
      Exit For
  End If
Next


Application.Lock
Application(\"users\") = users
Application(\"refresh\") = refresh
Application.Unlock
%>
<h3>People Online: <%=Application(\"NumUsers\")%></h3>
<%
For i = 1 To 50
  If users(i)<> \"\" Then
      Response.Write \"<a href=user_show_user.asp?user=\" & users(i) & \">\" & users(i) & \"</a><br>\"
  End If
Next
%>

So if anyone has a good idea or advice of how I would add there email as well it would be great :)
Guzzie
Avatar billede guzzie Nybegynder
07. maj 2001 - 13:47 #1
Never Mind :)
Created a list with session ID instead of session name :)
Guzzie
Avatar billede emingos Nybegynder
12. maj 2002 - 03:09 #2
want to help me make one ? :)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester