Allora questo è il frame dove scrivo il messaggio (msg.asp)

<meta http-equiv="Content-Language" content="it">
<link rel="stylesheet" type="text/css" href="chat.css">
<base target="principale">
<body class=messages topmargin="0" leftmargin="0" rightmargin="0" onload="document.msgchat.chat.focus()">

<form method=POST action="chat.asp#fondo" target=principale onsubmit="setTimeout("this.form.chat.value='';",20 )" name="msgchat">


<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="40">
<tr>
<td width="12%"><font size="1">MESSAGGIO</font></td>
<td width="40%"><input type="text" size="50" name="chat" style="border-style: solid; border-width: 1; background-color: #F7F7F7"></td>
<td width="38%"><input type="submit" value="Invia" size="20"></td>
</tr>
</table>
<input type="hidden" value="msg" name="azione" size="20">
</form>

questo è il frame che riceve il messaggio (chat.asp)

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Language" content="it">
<link rel="stylesheet" type="text/css" href="chat.css">
<title>La Chat</title>
<base target="msg">

<script>
parent.msg.document.forms(0).chat='';
</script>

<script language="JavaScript">
function chiudimi()
{
parent.close();
}
</script>

</head>

<body class=messages topmargin="0" leftmargin="0" rightmargin="0" onLoad="window.setTimeout('chiudimi()', 50000)">
<div class=hdr>La Chat</div>


<%

Response.Expires = 10
Response.Buffer = True

if request.form("azione")="msg" and len(request.form("chat"))>0 then

'AGGIUNGI MESSAGGIO

arrmsg = Application("msg")
arrmsg = arrmsg & "#§#" & Now() &_
"|#|" & Session("ID") & "|#|" &_
Request.Form("chat")

Application.Lock
Application("msg") = arrmsg
Application.UnLock

Response.Redirect("chat.asp#fondo")

end if


'recupero messaggi

Response.write "<HTML><HEAD>"
Response.write "<META http-equiv=""REFRESH"" content=""5; url=#fondo"">"
Response.write "</HEAD>"

arrMsg = Application("msg")

if len(arrMsg) >0 then


arrMsg = Split(arrMsg, "#§#")

for j = 1 to ubound(arrMsg)
msg = Split(arrMsg(j), "|#|")
Response.write "[*]<font face=Arial Size=2 color=gray>"
Response.write msg(0)
Response.write "</font><font face=Arial Size=2 color=#333333>"
Response.write " [ "
Response.write msg(1) & " ] - "
Response.write "</font><font face=Arial Size=2 color=#FF0000>"
Response.write msg(2) & "</font>"

next

Response.write "<a name=fondo></a>"
end if

%>
</body>
</html>

Questo è invece il frame che raccoglie gli utenti loggati e li visualizza (users.asp)

<META http-equiv=""REFRESH"" content=""5;>
<link rel="stylesheet" type="text/css" href="chat.css">
<body class=messages topmargin="0" leftmargin="0" onUnload="window.open('logout.asp','chk');">
<div class=hdr>Utenti Connessi</div>

<%

dim arrUtenti

arrUtenti = Split(Application("Users"),"|")

for i = 0 to UBound(arrUtenti)

if arrUtenti(i) = Session.contents("id") then

arrUtenti(i) = "<font face=Arial Size=2 color=333333>"&arrUtenti(i)&"</font>
"
else
arrUtenti(i) = "<font face=Arial Size=2 color=333333><a href=Scheda.asp?User="&arrUtenti(i)&" target=_blank>"&arrUtenti(i)&"</a></font>
"
end if

Response.Write arrUtenti(i)"
next

%>

Come vedete nel frames users utilizzo onUnload="window.open('logout.asp','chk'); in modo tale che quando la finestra viene chiusa lui disconnette l'utente:

Questa è la pagina logout.asp

<% @ Language=VBScript %>
<% Option Explicit %>
<%
Session.Contents.Remove("id")
%>
<script>
window.close();
</script>

Sono tante le cose che vorrei chiedervi:

1) Quando scrivo un msg sul campo chat del form msgchat dopo che clicco sul tasto invia oppure clicco invio sulla tastiera, dovrebbe azzerarsi il campo e trasferire il messaggio appena digitato sul frame principale;
in questo momento trasferisce il messaggio ma non si resetta il campo.

2) Quando apro il popup parte il tempo per chiudersi automaticamente lo stesso popup ma se scrivo un messaggio oppure mando un messaggio privato ad un utente ( Questa parte devo ancora svilupparla ) si dovrebbe riazzerare il tempo di chiusura;
in questo momento dopo essersi aperto il popup si chiude podo 50 seconti.

3) Quando si collega un utente scrivo la username dell'utente dentro una variabile di sessione chiamata Session.contents("ID").

Quando chiudo la finestra e parte la pagina logout.asp dovrebbe cancellare la variabile Session.contents("ID") ma in effetti non lo fa.

4) Per ultimo ho notato non mi visualizza in modo corretto gli utenti collegati in chat, cioè me li elenca in orizzontale e non in verticale.

Lo so ci vuole una settimana di tempo per rispondermi a tutto ma se avete un po di pazienza a risolvermi questi problemi ve ne sarei grato tantissimo.

Aspetto vostre notizie

E grazie in anticipo