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

  • Home
  • SEARCH
  • 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 6814751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:43:32+00:00 2026-05-26T20:43:32+00:00

Hey guys i’m making a website where you submit a server for advertising. When

  • 0

Hey guys i’m making a website where you submit a server for advertising. When the user goes to the index page of my website it grabs the ip’s of all the servers submitted and then tests to see if it is online using fsockopen() like so:

while($row = mysql_fetch_assoc($rs)) {

    $ip = $row['ip'];

    $info = @fsockopen($ip, 25565, $errno, $errstr, 0.5);

     if($info) {
    $status = "<div><img width='32px' height='32px' 
            title='$name is online!' src='images/online.png'/></div>";

    $online = true;

    } else {

    $status = "<div><img width='32px' height='32px' 
            title='$name is offline!' src='images/offline.png'/></div>";

    $online = false;
    }

}

}

This way works fine, but the only downside is when you load the site it takes a good 2-4 seconds to start loading the website due to the fsockopen() methods being called. I want to know if there is a better way to do this that will reduce the amount of wait time before the website loads.

Any information will be appreciated, thanks.

  • 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-26T20:43:33+00:00Added an answer on May 26, 2026 at 8:43 pm

    Store the online status and last check time in a database, if the last check time is longer than 15 minutes for example, update it. I am pretty sure you don’t need to get the status on EVERY pageload? It’s the time it takes to connect to each server that slows down the website.

    Then again, you would probably wanna move the update process to a cronjob instead of relying on someone visiting your website to update the server statuses.

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

Sidebar

Related Questions

Hey guys i'm making a website but for some reason my div tags are
Hey guys, trying to optimize this query to solve a duplicate user issue: SELECT
hey guys, I have mypage.com/user-login.php?action=register and I want to be able to call mypage.com/register
Hey guys I was wondering how I could make the title of my website
Hey guys im making a c++ game and im trying to load a bitmap
Hey guys I am making a terminal application using Swing and Apache Commons. I
Hey guys I am making a 2D game and I have generating a random
Hey guys I'm building my first website and I cannot figure how to get
hey guys, i'm getting an exception on the following inner exception: {Value cannot be
Hey guys i wrote a quick test. I want delete to call deleteMe which

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.