ASP Forum
chat room
sandwichs | Posted 12:18am 3. April 2004 Server Time |

Hi, I've been trying for a while to get a chat room on my web site... the problem using asp is the "refresh time" I don't like it. So I found a nice little java chat room (spottalk server) It works fine but I don't want the users to type their username... I'd need to get the user name from a cookie but I don't know how to get it if it's not into an asp page(this is a shtml).
Here is a java code, If someone could show me how to do
"username=request.cookies("Usern")" into this code... I'd be happier :)

<html>
<head>
<title>Powered by SpotTalk</title>


</head>

<body onLoad="document.loginform.param1.focus();">

<center>
<br>
<br>
<br>
<b>Pick a username to just chat as a guest</b><br>
<br>
<a href="login.shtml">or click here to log in as a registered user</a><br>
<br>
<form name=loginform action="http://<SPOTTALK DOMAINNAME>:<SPOTTALK PORT>/java_frameset.html" method=get>
Guest username: <input type=text name=param1 size=20 maxlength=20 ><br>

<!-- Example of allowing user to select a room
Log into this room: <select name=param3>
<spottalk listrooms> <option value="<spottalk roomname>"><spottalk roomname></option>
</spottalk></select><br>
-->
<input type=hidden name=param3 value="The Doghouse Room">

<br>
<input type=hidden name=command value="/login">
<input type=hidden name=param4 value="guestlogin">
<input type=hidden name=errorfile value="error.shtml">
<input type=submit value="Start Chatting"><br>
<br>
</form>
<a href="loginguesthtml.shtml" class=small>Having trouble logging in? Firewall? Browser problems? Click Here...</a><br>
<br>
<br>
<div align=right><a target=_blank href="http://www.spottalk.com">
  <img src="/images/poweredbyspottalk.gif" border=0 width="110" height="22"></a></div>
</body>
</html>
Kevinneke | Posted 7:55am 4. April 2004 Server Time |

Hm, this is a start, <input type=text name=param1 size=20 maxlength=20 value=" & username & ">
<%
username = request.cookies("Usern")
%>

So, the user can always change the value, I don't know but I think you can protect the inputfield (user can't change the field). Hope this is what you want... .
sandwichs | Posted 11:30pm 4. April 2004 Server Time |

I can always put the username name in a hiddeen field but since the page in not an asp page..
<%
username = request.cookies("Usern")
%>
this does not work.... I think I need the "java" version of this... but I don't know the first thing about java
Sophie123 | Posted 9:35am 16. February 2008 Server Time |

hi
mp3cdman | Posted 5:42pm 6. March 2008 Server Time |

just change the extension on this file to .asp and then just change

<input type=text name=param1 size=20 maxlength=20 >

to

<input type=text name=param1 size=20 maxlength=20 value="<%=request.cookies("Usern") %>">

mp3cdman ;-D


Reply to Post chat room



Back to Forum Page