Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 609979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:37:29+00:00 2026-05-13T17:37:29+00:00

I am building a simple ajax chat client for a school project and have

  • 0

I am building a simple ajax chat client for a school project and have thought of a way to implement this, but it seems IMO to be very cumbersome approach:

1) User A sends message which is accepted by a server-side PHP script and saved to database
2) The browser of User B periodically launches a server side PHP script to check if there are any messages in the database for User B. PHP script finds messages from User A and returns them.

Is this the right approach? Can communication between these two users be achieved without a database?

(This is my first web-application…if I was making this without browsers + HTTP, I would just make a Java program with persistent class that listened on TCP sockets, and forwarded messages to the appropriate address)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:37:30+00:00Added an answer on May 13, 2026 at 5:37 pm

    Yes your solution is good enough for starting. What you are doing is polling the server if there are any chat messages for a particular user. Good enough.

    But if you wanna goto the next level, (probably could be tough), you can have a server which can push new messages onto client browsers. This is called “Comet”. But it will need extensive server resources (if your userbase is going to exceed to thousands).

    Try your method first and go for this next.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im building a simple chat client which is only supposed to be able to
I'am building simple Ajax application (via jquery). I have strange issue. I found where
I'm just building a simple ajax site but running into a problem in safari
 Does anyone have a real-world experience in building such a project? I'd like to
I'm building an ASP.NET MVC site where I want to implement jQuery AJAX calls
I have a simple jquery ajax call which posts a car manufacturer and responds
I have a pretty limited experience with AJAX and javascript so hopefully this is
I am building an AJAX powered website which uses the Really Simple History (RSH)
I am building a site that uses a simple AJAX Servlet to talk JMS
I am currently building a simple ajax interface for a booking and tracking from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.