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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:55:23+00:00 2026-05-27T17:55:23+00:00

i wish to develeop a php mysql based social networking site. Registered users will

  • 0

i wish to develeop a php mysql based social networking site. Registered users will have the option to add another user as a friend just as is done in Facebook.

If user A clicks on the ‘add friend’ link on user B’s profile, friend-request records will be made in A’s and B’s databases accordingly. When B visits the waiting friend-requests- showing-page ( as such the profile page), the request will be shown querying B’s db.This much is pretty simple to do i think.

But while B is online, C can make a friend-request to B. I want to make a notification to B that C has made such a request even if B does not refresh his/her profile page(or any page with the option of showing the waiting friend-requests ). As to the type of notification, it can be a box showing the total number of friend-requests waiting. Clicking on the box will show the details. Or it could be in any other form.

My point of interest is how to make B aware of a new friend request while B is online without making him/her refresh the page containing the friend-requests?

  • 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-27T17:55:24+00:00Added an answer on May 27, 2026 at 5:55 pm

    To finalize the answers, I assume that you understand the database/notification DATA logic well, and now you are concerned only about HOW TO deliver it to the browser. I will list all the points here.

    1. HTTP is a PULL protocol. You cannot push data from Server to Client.
    2. So, what you can do is – continuously poll the server for new notifications.

    You can do two types of polling :-

    1. Short-polling – You send an Ajax request to the server for new notifications.
      • This is a short request, but you do it continuously in an interval (say 10s)
      • The server process the PHP and immediately returns.
      • You process the returned data (eg. Show notifications)
    2. Long-polling – You send the same request as above. BUT…
      • In this, the requested PHP file goes into an infinite loop, checking DB continuously.
      • When a DB change is there, the PHP file “echo” it and ends the loop. Now the request is completed, and data is received at Browser.
      • You process the data.
      • Start another long-poll Ajax request, and the steps repeat again.
      • (Extra: If the PHP is not completed in a particular timeout, then abort the current request and start new one.)

    Next, you can implement any of these in two different ways:-

    1. Write your own Javascript code – Needs some expertise, but you can learn it!
    2. Use some libraries – Easy, and time-saving. You can use PubNet, BeaconPush etc.

    I hope that this makes a clear idea to you!

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

Sidebar

Related Questions

I wish to develop some kind of external API which will include users putting
I am willing to develop a mobile application. I wish to have something working
I wish to test a function that will generate lorem ipsum text, but it
I wish to build a sms application in php from scratch. Please guide me
I have a web app(jsp/servlets) which allows users to download audio files and play
i wish bind the mouse icon in a Visual Brush,i.e i have a Canvas
I need to develop a process that will detect if the users computer has
I wish to use Google custom search and in particular would like to have
I wish to have a submit button (for the default form action), and an
I have just finished developing an iPhone app and now I wish to make

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.