Click to See Complete Forum and Search --> : page seperator
dragondad
11-25-2003, 02:03 PM
hi;
ive tried to post 3 chatrooms on my chat site but all the rooms are displaying the same messages, on my site i have the following:-
dragons lair
users online
flirt
users online
lounge
users online
ringtons
logout
this is what the members see but all the users on line numbers are the same too not independant although all the href's are different to different rooms, ive copyied the instuctions to go to different rooms and put 3 rooms in the html home folder all with the correct names but for some reason if a member posts a message in flirt the same message appears in lounge, any ideas what ive done wrong?
sorry complete novice at this
96turnerri
11-25-2003, 02:11 PM
not sure what youve done as you given no url or code, so would need that to help you
dragondad
11-25-2003, 02:14 PM
sorry im using java script but would love to transfer to whml if i knew how to do it. my url is http://grantnh.com/index.jsp but ive taken it off now cause it was not working, ill put the coding up in here in 2 mins whist i get it.
dragondad
11-25-2003, 02:18 PM
<%@ page language="java" import="java.sql.*,java.util.*,java.util.Date,java.lang.String" %>
<%
Integer count = null;
synchronized (application) {
count = (Integer) application.getAttribute("basic.counter");
if (count == null)
count = new Integer(0);
count = new Integer(count.intValue() + 1);
application.setAttribute("basic.counter", count);
}
%>
<%
String user_id = request.getParameter ("user_id");
Connection connection = null;
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
connection = DriverManager.getConnection("jdbc:mysql://localhost/grantnh3_wyrlezchat?user=grantnh3_pchat1&password=$helen$");
Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery("SELECT count(*) as user_count FROM user_login_tbl");
String user_count = "";
while ( rs.next() ) {
user_count = rs.getString("user_count");
}
statement.close();
rs.close();
connection.close();
%>
<%@ page contentType="text/vnd.wap.wml" %>
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head>
<meta http-equiv="Cache-control" content="no-cache" forua="true"/>
<meta http-equiv="Cache-control" content="must-revalidate" forua="true"/>
</head>
<card id="card1" title="Main Menu" newcontext="true">
<p><anchor>Dragons Lair(<%=user_count%>)<go href="dragon.jsp" method="post"><postfield name="username" value="<%=user_id%>"/><postfield name="message" value="Enters the chat "/></go></anchor></p>
<p><anchor>Users Online<go href="list_users.jsp" method="post"><postfield name="user_id" value="<%=user_id%>"/></go></anchor></p>
<%
it is this last bit i am coping and pasting and changing the href to go to rooms of the same name, in theory though its not and i cant see what i have done wrong to seperate them, any ideas why?
ray326
11-25-2003, 10:51 PM
That's not Javascript, it's just really bad Model 1 JSP.