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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:20:36+00:00 2026-05-26T11:20:36+00:00

Hey i need help with this server status script. What is happening is when

  • 0

Hey i need help with this server status script. What is happening is when I use this script It doens’t display anything at all.. This is ym current code:

    <?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');

$ip = $_GET['ip'];
$port = $_GET['port'];


    /* Attempt to open */
        $im = @imagecreatefrompng('status.png');
        // Set the content-type
        header('Content-type: image/png');
        //check to see if server is online or offline
        $socket = fsockopen($ip, $port, $errno, $errstr, 1);

        if($socket) {
        $text = 'Online';
        $color = imagecolorallocate($im, 0,255,0);
        } else {

        $text = 'Offline';
        $color = imagecolorallocate($im, 255,0,0);
        }


        /* See if it failed */
        if($im)
        {
            // Create some colors
        $white = imagecolorallocate($im, 255, 255, 255);

        imagefilledrectangle($im, 0, 0, 399, 29, $white);

        // Replace path by your own font path
        $font = 'Arial Bold.ttf';

        // Add some shadow to the text
        imagettftext($im, 20, 0, 11, 21, $color, $font, $text);

        // Add the text
        imagettftext($im, 20, 0, 10, 20, $color, $font, $text);

        // Using imagepng() results in clearer text compared with imagejpeg()
        imagepng($im);
        imagedestroy($im);

        } else {
         print("Error finding image $image</br>");
    }
    ?>

What I want it do to is check if a server is online, and if it is then display Online on the background image status.png but when I use the following url format: Myurl/getStatusImage.php?ip=94.249.187.82&port=25565 It displays a blank page.

Thanks for any help.

  • 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-26T11:20:36+00:00Added an answer on May 26, 2026 at 11:20 am

    Congrats fella, it’s time to get acquainted with programming.
    And learn some debugging techniques.

    In fact, not a soul in the world can tell you what’s wrong with your code, on your server in your environment. But only your own code you can ask for it.

    First of all, comment out header line and see what it says.
    and – oh – remove all the boody @’s from the code!
    so you’ll be able to see if any error occurred.

    Then divide your code into 2 chunks – getting info part and creating an image part. Run both separately until each works perfect. And only then combine them up.

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

Sidebar

Related Questions

Hey all need a lil help sorting a loop for this table out, cant
Hey all i am in need of some help trying to figure out how
Hey all, i am in need of some help with keeping an image aspect
Hey Guys...need help. Working on a project and get this error on the Output
Hey all, i am in need of some help trying to figure out why
Hey all, i am in need of some help with figuring out how to
Hey all i am in need of a little help with figuring out how
Hey, i need a little help with this django function. I wan't to insert
Hey guys! I need some help writing a code that creates an array in
Hey guys I need some help with this: I have two view controllers, let's

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.