SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help building an instant messaging system with AJAX/PHP

    Hi guys,

    I am trying to add an instant messaging system to my website so that logged in member can chat one-on-one with other member on his/her contact list. I am aware that there are many of such free scripts that I can use but I would rather learn to do it myself. So, could anyone please tell me how to set it up or at least where the resources are.

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should be very familiar with using php, and a database like mysql. You can have the page refresh itself periodically to get the latest list of messages. As an enhancement, you could instead use ajax to update the page.

    You might consider looking at some of the existing source code to get some ideas.

  3. #3
    SitePoint Addict Zarin Denatrose's Avatar
    Join Date
    Jan 2009
    Location
    Surrey BC, Canada
    Posts
    309
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, you need to pick a place to start. You can either go from the user interface to the functionality, or set up the mechanics and worry about the basic design later.
    Either way, you should put together a list of things you need.

    Interface:
    Message Container
    Send Message Form

    Client Ajax Functions:
    Send Message
    Request Messages
    Update Message Container

    Server Functions:
    Receive Message
    Clean Message
    Insert Message into DB
    Get Messages from DB
    Output messages

    These are just general things to put together to get chat functionality - going with one on one chat would need ways of alerting users to new messages from users they're not currently watching. I'd be happy to help walk you through some of the steps to building a basic system.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •