manonng
asked on
virtual chat/interactive chat
How to write a interactive chatting(text based) system in cold fusion? I have been visited few web sites, they offered a activeX/ COM object that can enhance with CF, but normally they would ask me to pay for the full working version,and I don't want to.
Are there any developer had experienced on these type of application and would like to share with me/or everyone in this web site?
Are there any developer had experienced on these type of application and would like to share with me/or everyone in this web site?
to make an application like nathans refers to (refresh the page that the chat window is in) just make a simple cf script (chatwindow.cfm) like this:
========================== ========== ====
<cfif isdefined('form.text')>
<cfquery dsn="....>
(delete old text here)
</cfquery>
<cfquery dsn="....>
insert into chattext(entrytime, userID, chatroomID, text)
values(#now()#, #session.userID#, #session.chatroomID#, #form.text#)
</cfquery>
</cfif>
<cfquery name=chatwindow>
select chattext.entrytime, chattext.text, users.username
from users, chattext
where chatroomID=#session.chatro omID# and chatwindow.userID = users.userID
order by entrytime
</cfquery>
<meta http-equiv="refresh" content="#session.refresh# ; URL=chatwindow.cfm">
<cfoutput>
#chatwindow.entrytime# #chatwindow.username# #chatwindow.text#<br>
</cfoutput>
<form action=addtext.cfm method=post>
<input name=text><input type=submit value=submit>
========================== ========== ====
i can work out the tables and the session variables if you want to give more points ;-)
cheers.
==========================
<cfif isdefined('form.text')>
<cfquery dsn="....>
(delete old text here)
</cfquery>
<cfquery dsn="....>
insert into chattext(entrytime, userID, chatroomID, text)
values(#now()#, #session.userID#, #session.chatroomID#, #form.text#)
</cfquery>
</cfif>
<cfquery name=chatwindow>
select chattext.entrytime, chattext.text, users.username
from users, chattext
where chatroomID=#session.chatro
order by entrytime
</cfquery>
<meta http-equiv="refresh" content="#session.refresh#
<cfoutput>
#chatwindow.entrytime# #chatwindow.username# #chatwindow.text#<br>
</cfoutput>
<form action=addtext.cfm method=post>
<input name=text><input type=submit value=submit>
==========================
i can work out the tables and the session variables if you want to give more points ;-)
cheers.
hadn't really thought about using CF to do a chat room..nice idea, meverest..
i wouldn't try doing it with an access database unless you have to..too many concurrency problems, seems to trash the database too easily, but would work great with a real database..
i wouldn't try doing it with an access database unless you have to..too many concurrency problems, seems to trash the database too easily, but would work great with a real database..
until i tapped out the above, i thought it would be more complex. as it turns out, one could write a fully functional multi-room chat in less than an hour.
that's CF for ya'
cheers.
that's CF for ya'
cheers.
You need to give meverest the points...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi meverest,
Did you receive my 50 points? I have confirmed your comment as my answer
a week ago!!
let me know if you still have not received my points!!
Manon
Did you receive my 50 points? I have confirmed your comment as my answer
a week ago!!
let me know if you still have not received my points!!
Manon
it must not have completed properly as this question is still awaiting evaluation...
cheers!
cheers!
ASKER
Hi meverest,
I have confirmed, hoping you get 50 points ASAP
manon
I have confirmed, hoping you get 50 points ASAP
manon
ActiveX or Java those are the ones I would do.
There are Perl Chats out there but they do the same thing refresh the page that the chat window is in I don't like this...
Sorry, I just had to say all of that take no offense. If it was me I would go with Java 1st or ActiveX next.
Nathan