Avatar billede zteiner Nybegynder
03. august 2001 - 11:15 Der er 3 kommentarer og
1 løsning

Hjælp Hurtigt !!!!!

Jeg er ved at lave en chat og jeg har lavet dette dokument som for-/login side, men når jeg kører siden over nettet kommer denne besked :

Application(\"conversation\") = \"<b><i>\" &

______________________________________________________

Her er kildekoden :

*********************
<% Option Explicit %>
<% Response.Buffer = True %>

<% If trim(Request.Form(\"name\")) = \"\" Then %>
<h1>Welcome to the Chat</h1>
The cafe is a casual gethering place to meet new friends nad chat with old ones.<p>
To enter the Chat, type the name you wish to use below and click the button.<p>
<form action=\"default.asp\" method=\"post\">
<p> Your Name : <input type=\"text\" size=\"20\" name=\"Name\"></p>
<p><input type=\"submit\" name=\"Submit\" value=\"Enter\"></p>
</form>
<%
Else
    Dim users, refresh
    session(\"name\") = Request.Form(\"name\")
   
    If Application(\"NumUsers\") = 0 Then
        \' Initialize (or re-initialize the user list
        \' and the converrsation
        ReDim temp1(50)
        ReDim temp2(50)
        Application(\"users\") = temp1
        Application(\"refresh\") = temp2
    End If
   
    \' Retrieve the application arrays
    users = Application(\"users\")
    refresh = Application(\"refresh\")
   
    \' Fint an empty spot and add the new user
    Dim i
    For i = 1 to 50
        If users(i) = \"\" Then
            users(i) = Session(\"name\")
            refresh(i) = time
            Application.Lock
            Application(\"NumUsers\") = Application(\"NumUsers\") + 1
            Application.Unlock
            Exit For
        End If
    Next
    If i = 51 Then Response.Redirect \"toomany.asp\"
   
    \' Put the arrays back in the application vars
    Application.Lock
    Application(\"users\") = users
    Application(\"refresh\") = refresh
    Application.Unlock
   
    If not IsEmpty(Application(\"conversation\")) Then
        Application.Lock
        Application(\"conversation\") = \"<b><i>\" &
            Session(\"name\") &_
            \" Enters The Room</b></i><br>\" &
            Application.Unlock
        End If
       
        Response.Redirect \"cafe.asp\"
    End If
%>
******************************

Svar søges meget hurtigt !!
Avatar billede runesoft Nybegynder
03. august 2001 - 11:19 #1
du har nogle linieskift, hvor der ikke skal være.

<% Option Explicit %>
<% Response.Buffer = True %>

<% If trim(Request.Form(\"name\")) = \"\" Then %>
<h1>Welcome to the Chat</h1>
The cafe is a casual gethering place to meet new friends nad chat with old ones.<p>
To enter the Chat, type the name you wish to use below and click the button.<p>
<form action=\"default.asp\" method=\"post\">
<p> Your Name : <input type=\"text\" size=\"20\" name=\"Name\"></p>
<p><input type=\"submit\" name=\"Submit\" value=\"Enter\"></p>
</form>
<%
Else
    Dim users, refresh
    session(\"name\") = Request.Form(\"name\")
   
    If Application(\"NumUsers\") = 0 Then
        \' Initialize (or re-initialize the user list
        \' and the converrsation
        ReDim temp1(50)
        ReDim temp2(50)
        Application(\"users\") = temp1
        Application(\"refresh\") = temp2
    End If
   
    \' Retrieve the application arrays
    users = Application(\"users\")
    refresh = Application(\"refresh\")
   
    \' Fint an empty spot and add the new user
    Dim i
    For i = 1 to 50
        If users(i) = \"\" Then
            users(i) = Session(\"name\")
            refresh(i) = time
            Application.Lock
            Application(\"NumUsers\") = Application(\"NumUsers\") + 1
            Application.Unlock
            Exit For
        End If
    Next
    If i = 51 Then Response.Redirect \"toomany.asp\"
   
    \' Put the arrays back in the application vars
    Application.Lock
    Application(\"users\") = users
    Application(\"refresh\") = refresh
    Application.Unlock
   
    If not IsEmpty(Application(\"conversation\")) Then
        Application.Lock
        Application(\"conversation\") = \"<b><i>\" & Session(\"name\") &_
            \" Enters The Room</b></i><br>\"
        Application.Unlock
        End If
       
        Response.Redirect \"cafe.asp\"
    End If
%>
Avatar billede erikjacobsen Ekspert
03. august 2001 - 11:19 #2
Smæk det på én linie:

      Application(\"conversation\") = \"<b><i>\" & Session(\"name\") & \" Enters The Room</b></i><br>\"
Avatar billede runesoft Nybegynder
03. august 2001 - 11:20 #3
øhh...

<% Option Explicit %>
<% Response.Buffer = True %>

<% If trim(Request.Form(\"name\")) = \"\" Then %>
<h1>Welcome to the Chat</h1>
The cafe is a casual gethering place to meet new friends nad chat with old ones.<p>
To enter the Chat, type the name you wish to use below and click the button.<p>
<form action=\"default.asp\" method=\"post\">
<p> Your Name : <input type=\"text\" size=\"20\" name=\"Name\"></p>
<p><input type=\"submit\" name=\"Submit\" value=\"Enter\"></p>
</form>
<%
Else
    Dim users, refresh
    session(\"name\") = Request.Form(\"name\")
   
    If Application(\"NumUsers\") = 0 Then
        \' Initialize (or re-initialize the user list
        \' and the converrsation
        ReDim temp1(50)
        ReDim temp2(50)
        Application(\"users\") = temp1
        Application(\"refresh\") = temp2
    End If
   
    \' Retrieve the application arrays
    users = Application(\"users\")
    refresh = Application(\"refresh\")
   
    \' Fint an empty spot and add the new user
    Dim i
    For i = 1 to 50
        If users(i) = \"\" Then
            users(i) = Session(\"name\")
            refresh(i) = time
            Application.Lock
            Application(\"NumUsers\") = Application(\"NumUsers\") + 1
            Application.Unlock
            Exit For
        End If
    Next
    If i = 51 Then Response.Redirect \"toomany.asp\"
   
    \' Put the arrays back in the application vars
    Application.Lock
    Application(\"users\") = users
    Application(\"refresh\") = refresh
    Application.Unlock
   
    If not IsEmpty(Application(\"conversation\")) Then
        Application.Lock
        Application(\"conversation\") = \"<b><i>\" & Session(\"name\") & \" Enters The Room</b></i><br>\"
        Application.Unlock
        End If
       
        Response.Redirect \"cafe.asp\"
    End If
%>
Avatar billede zteiner Nybegynder
03. august 2001 - 11:23 #4
tak
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