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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:42:01+00:00 2026-05-30T09:42:01+00:00

I have made a chat box like thing in PHP. The only problem is

  • 0

I have made a chat box like thing in PHP. The only problem is that it doesn’t automatically reload. Is there a way to make it reload in PHP, or would I have to move everything around so I can use AJAX? Also, one of my users is constantly online. I have set it to be that they are offline if they have pressed a key or clicked in the last 3 minutes and to set them offline when they leave the page. They are using Firefox 9.0. Is this because of the use of onunload? What would be a solution?

  • 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-30T09:42:02+00:00Added an answer on May 30, 2026 at 9:42 am

    You could use a meta refresh tag, that could be generated by PHP, but its not really a PHP-specific feature.

    <meta http-equiv="refresh" content="600">
    

    This will refresh the content after 600 seconds. You could throttle that time more accurately based on your applications demands.

    Ajax is probably the preferred method for checking user inactivity. Here is a similar post on checking user activity – How can I detect with JavaScript/jQuery if the user is currently active on the page?

    UPDATE

    As for the second question of how to handle exit of a user in Firefox, its like you said that onunload can be inconsistent. This is where the use of ajax shines again. If your app stops receiving ajax updates from the client, you can do some sort of cleanup to mark them as inactive.

    We had a similar situation in an ASP.Net MVC app. We ended up using Application Variables to store recent activity and state of users. A php example can be found here.

    Hope this helps!

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

Sidebar

Related Questions

i have a java chat server & client, that works fine. I made a
I have made a Linux CUI app that communicates between processes via Message-quene. There
hi I have a scenario like this I made a chat program where a
I have made a chat script using php, mysql and jquery. It uses json
I have made an AJAX chat using Javascript, PHP, and MySQL. I send the
I have made a SVG image, or more like mini application, for viewing graphs
I made a while loop in php: <?php include_once(connect.php); $search=mysql_query(SELECT * from chat ORDER
I made this PHP chatbox which supports some JavaScript code. I have these 'images'
I have made a simple chat script using jquery and AJAX but the huge
I have made a chat program with using Winsock2.h and the lib file ws2_32.lib.

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.