Jump to content


Photo

How To Make Live Chat Between 2 Users?


  • Please log in to reply
5 replies to this topic

#1 elementz

elementz
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts

Posted 22 July 2006 - 01:57 PM

How would I go about making a live chat between 2 registered users. I am making an RPG site and wanted to know how to allow two users to request a chat with each other and then to actually being able to chat. I want them to be able to press close image and the connection closes or when the browser is closed, any ideas on how to do this?

#2 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 22 July 2006 - 02:02 PM

I suppose if you wanted you could run an IRC channel and send a command to a botserv to join a unique channel and then direct the users to this channel with a key to enter using a java applet.. The only way to do it with PHP would be to store everything in a database and get the page to auto reload therefore fetching all text from the database. This will be slow and means the page would be reloaded every few seconds so not the best way. Can't see any fast way with PHP as it's clientside and gets parsed as soon as the page is loaded.

Regards
Liam
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#3 steelmanronald06

steelmanronald06
  • Staff Alumni
  • Advanced Member
  • 2,004 posts
  • LocationOk

Posted 22 July 2006 - 02:12 PM

Perhaps AJAX and a database?  That is all you would really need, and it might save on bandwidth a bit.

#4 freakus_maximus

freakus_maximus
  • Members
  • PipPipPip
  • Advanced Member
  • 177 posts

Posted 22 July 2006 - 02:21 PM

Just a quick google and found some solutions (free) right out there...but this one in particular looked decent, although I cannot see if there are any moderator functions available...

http://socket7.net/lace/

or if you want to really learn how to get started implementing check this out...nothing fancy here..

http://www.ajaxproje...ls.php?itemid=9

#5 Joe Haley

Joe Haley
  • Members
  • PipPipPip
  • Advanced Member
  • 103 posts
  • LocationCanada, eh?

Posted 22 July 2006 - 02:29 PM

While the website is down at the molment,
http://www.phpfreechat.net/
is what i have used for chatting. The latest beta supports channels, private messaging, admins, ext. All the features you could want. The soure would be a bit dificult to modify to a novice, but its generally well-written.
Give a man a fish; you have fed him for today.  Teach a man to fish; and you have fed him for a lifetime
Don't teach men to program. Teach them to fish.

Please, try the RTFM solution before asking for help:
http://php.net/manual/en/index.php

#6 Slowchaos

Slowchaos
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 25 September 2006 - 07:03 PM

I was experimenting with this and I managed to create a chat program using php sockets and a java applet / javascript on the client side. The java applet was hidden and the page where the chat took place was a standard html page. Unfortunately, the page is not currently active or I would provide a link to demonstrate. If anyone wants more details I might be able to help.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users