Hello
I have a default ASP page which is where users type in a username to login to a chat. But at the moment, the Webmaster is unaware that a site visitor wishes to chat, so I was hoping to create a sound alert to notify the Webmaster (the sound should not be heard by the site visitor).
I imagine that the sound would need to load when the user presses the log-in button, and that I would need to use <embed>sound.mp3</embed>, but I am unsure where to put it in my stripped down code below:
Thanks for any advice/help.
Blueie
I have a default ASP page which is where users type in a username to login to a chat. But at the moment, the Webmaster is unaware that a site visitor wishes to chat, so I was hoping to create a sound alert to notify the Webmaster (the sound should not be heard by the site visitor).
I imagine that the sound would need to load when the user presses the log-in button, and that I would need to use <embed>sound.mp3</embed>, but I am unsure where to put it in my stripped down code below:
Code:
Dim mode, errorMessage
mode = Request("mode")
If (mode = "userLogin") Then
Dim userName
userName = Server.HTMLEncode(Request("username"))
If (countUsers() >= USERS) Then
errorMessage = getMsg("error.maximum_users_reached")
ElseIf (Len(userName) = 0) Then
errorMessage = getMsg("error.missing_username")
ElseIf (Len(userName) > MAX_USERNAME_LENGTH) Then
errorMessage = getMsg("error.username_length_exceeded", MAX_USERNAME_LENGTH)
ElseIf (userExists(userName)) Then
errorMessage = getMsg("error.username_in_use")
ElseIf (NOT isValidUsername(userName)) Then
errorMessage = getMsg("error.invalid_username")
ElseIf (isUserNameBlocked(userName)) Then
errorMessage = getMsg("error.username_blocked")
Else
Dim p
Set p = New Person
p.id = -1
p.name = userName
p.roomId = 0
p.ipAddress = Request.ServerVariables("REMOTE_ADDR")
' new chat user so create new id
Set p = addUser(p)
' tell all other users about this new user
Call addMessage( _
p.id, _
"-1", _
"<span class=LoggedIn><img src='images/new.gif' height=9 width=9> " & getMsg("user.logged_on", p.name, Now()) & "</span><br>" _
)
Session("user") = p.data
' redirect to new frame and create new user login
Response.Redirect("frames.asp")
Response.End
End If
......
<%= getMsg("login.join_chat", getMsg("application.name") & " " & getMsg("application.version")) %></td>
.......
<input type=text name=username value="<%= Server.HTMLEncode(userName) %>"
.......
<input type=submit class=btn name=login value="<%= getMsg("button.login") %>" border=0 tabindex=2 title="<%= getMsg("button.login.title") %>"></td>
Thanks for any advice/help.
Blueie