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 8462405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:09:28+00:00 2026-06-10T14:09:28+00:00

I am working on a project where i am trying to build an interface

  • 0

I am working on a project where i am trying to build an interface like If user is logged in and in between that if sever has any message for that user then the user will get notify immediately (Like facebook ) so for i am going through websockets but confused from where should i start ? please suggest me some basic ideas ?

I am using PHP as a language for implementation

I’m looking for advice at the moment on achieving real-time notifications using a mix of PHP, NodeJS and socket.io.
At the moment I have done next to nothing with Node and socket.io so I’m at a loss with the best way to achieve this. I’ve done some basically listening and what not but nothing extreme.

For now my questions are:

  1. How will socket.io know of new notifications, should PHP be responsible for sending the data (say a post was created) to socket.io and from there broadcasting to connected clients?
  2. How does socket.io know which clients want the notifications?

I’m really not sure what else. This is all a bit much for me at the moment. I just can’t get my head around how the notifications will be distributed.

Any advice would be greatly appreciated. I don’t expect a detailed walk through, just a push in the right direction or some knowledge on how it all meshes.

  • 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-06-10T14:09:30+00:00Added an answer on June 10, 2026 at 2:09 pm

    Start from reading what is websockets, how they work, what browser support. The internet is full for this information.

    For php implementation, take a look at the http://socketo.me/. PHP is not best suited for socket communication. I would use nodejs+socket.io and php for ‘regular stuff’. Don’t be afraid to mix technologies, there is no hammer for all problems.

    Edit:

    If you don’t know nodejs then it could be hard, but it’s worth your time to learn it.

    Some ideas:

    You can create table with notifications on your database, then if some event acccurs, ex. post added add record there (like number of new posts, and user_id), then from nodejs side connect to database fetch database and look for notifications for current user.

    Then nodejs notifies listening clients about changes (socket.io)

    If user reviews new posts update counter to 0, (something similar what facebook does when you have new message), and then nodejs will know that there are no new post, so nothing to notify.

    The hardest part is to get current user session.

    Some related:

    http://socket.io/

    What MySQL drivers are available for node.js?

    Sharing data between php and node.js via cookie securely

    Authenticate user for socket.io/nodejs

    Socket IO send to specified user ID

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

Sidebar

Related Questions

I'm trying to get MSBuild working on a project that has just been moved
I have a working project that Im amending, it crashes after trying to use
I'm working on a project that is trying to use context-free grammars for parsing
I'm trying to build a QRCodeReader for a project our research group is working
I am trying to build a Sudoku solver for a project I am working
I am trying to build a complicated web project that involves 4 websites that
I'm working on a project and trying to use JavaScript for validating all inputs
I'm working on a project and trying to render some images sitting under the
I am working on a VB.Net project and trying to get it to pull
I have a project working fine under MSVS 2010 SP1. I'm trying to convert

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.