views:

236

answers:

2

im tryig to create a chat system using php and javascript .i wonder how the chat in gmail works, will will remain in the same position even if we are going through dirrerent pages.it will be greatful if anyone clan explain me how it works.

And at the same time please give some ideas to create a chat s/m, like creation f the popup window, protocols to be used with etc

Thanks in advance :)

+1  A: 

I understand that you want to create a "Chat system",

Gmail's chat is not an isolated system, it is closely integrated/Synced with Gtalk , (do you plan on providing a Desktop app as well as a web interface?)

Secondly Gtalk/Gmail chat uses a custom protocol(although it is open..meaning you can write your own Gtalk clients as well).

For your "Chat System", if you want it to be as nice as Gmail's you'll definitely need to use

AJAX and JSON along with Java Script and PHP

AJAX will help you to create Eye Catching at the same time responsive UI and and JSON will help you to transport data along the wire.

Vivek Bernard
+2  A: 

Hi raki,

The chats in GMail, Facebook or Orkut stay at their same position even when you change pages thats because they are not doing a real page change when you click on any link inside GMail or Facebook or orkut. They load the page by means of a hash tag identifier and load the contents using standard AJAX. For example inside GMail you would find all links like inbox as https://mail.google.com/mail/?zx=xxxxxxx&shva=1#inbox and https://mail.google.com/mail/?zx=xxxxxxxx&shva=1#starred so when you click on them the browser doesn't actually reload a new page instead makes an AJAX request and pulls data in, hence this doesn't affect the chat block on the page.

You can have a look at http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=9#start for a simple PHP/MySQL based chat application. If you want a scalable chat application you have to go in Comet or "Bidirectional-streams Over Synchronous HTTP" BOSH. Friendfeeds TornadoWeb in python can help. http://www.tornadoweb.org/

Hope this info helps.

GeekTantra
thank you Geek, i know the things you said, but what my problem is i have a site ,and i need o add this chat to it. unfortunately its not done with ajax, thn how could i maintain this chat to be static, thats what am searching for :(
raki
@raki, I don't think you can do that. If you reload the page, you lose the contents of the chat box (unless you persist it in some way).Both answers here go for AJAX and I think so too.
Nir
is it possible is am using iframes , ie both the contents can be added to two iframes and re configure the site :(
raki