<?php
//------------------------------------------------------------------------
// PHP Enviromental's
ini_set('display_errors','0');
// PHP Enviromental's
//------------------------------------------------------------------------
// Check Port Function
function checkPort($ipAddress, $port) {
      $handle = @fsockopen($ipAddress, $port, $errno, $errstr,2);
      if ($handle == false) {
         return false;
      }
      else {
         return true;
      }
   }
// Check Port Function
header("Content-type: image/png");
$background = imagecreatefrompng('dfsafda98yf9yh9FDHG9DSHG9hgfdsgs.png');
$white = imagecolorallocate($background, 255, 255, 255);
$green = imagecolorallocate($background, 0, 64, 0);
$red = imagecolorallocate($background, 255, 124, 121);
$black = imagecolorallocate($background, 255, 255, 255);
imagettftext($background, 10, 0, 30, 56, $green, 'arial.ttf', '64.92.165.74');
// HTTP Only port 80
$status =  checkPort('64.92.165.74', 80);
   if ($status == true) {
      $data = 'Online';
      $color = $green;
   }
   else {
      $data = 'Offline';
      $color = $red;
   }
 // Checks the port
imagettftext($background, 10, 0, 47, 69, $color, 'arial.ttf', $data);
// HTTP Only port 80
// CPANEL Only port 2082
$status =  checkPort('64.92.165.74', 2082);
   if ($status == true) {
      $data = 'Online';
      $color = $green;
   }
   else {
      $data = 'Offline';
      $color = $red;
   }
imagettftext($background, 10, 0, 64, 135, $color, 'arial.ttf', $data);
//------------------------------------------------------------------------
// DNS Only port 53 
 // Checks the status of port 53
$status =  checkPort('64.92.165.74', 53);
   if ($status == true) {
      $data = 'Online';
      $color = $green;
   }
   else {
      $data = 'Offline';
      $color = $red;
   }
 // Checks the status of port 53
 //Writes the output
imagettftext($background, 10, 0, 38, 122, $color, 'arial.ttf', $data);
 //Writes the output
// DNS Only port 53
//------------------------------------------------------------------------
 // Checks the status of port 21
$status =  checkPort('64.92.165.74', 21);
   if ($status == true) {
      $data = 'Online';
      $color = $green;
   }
   else {
      $data = 'Offline';
      $color = $red;
   }
 // Checks the status of port 21
 // Writes the output
imagettftext($background, 10, 0, 39, 95, $color, 'arial.ttf', $data);
 // Writes the output
// FTP Only port 21
//------------------------------------------------------------------------
// MySQL Only port  3306
$status =  checkPort('64.92.165.74', 3306);
   if ($status == true) {
      $data = 'Online';
      $color = $green;
   }
   else {
      $data = 'Offline';
      $color = $red;
   }
imagettftext($background, 10, 0, 55, 109, $color, 'arial.ttf', $data);
// MySQL Only port  3306
//------------------------------------------------------------------------
// HTTPS Only port  443
 // Checks the status of port 21
$status =  checkPort('64.92.165.74', 443);
   if ($status == true) {
      $data = 'Online';
      $color = $green;
   }
   else {
      $data = 'Offline';
      $color = $red;
   }
 // Checks the status of port 21
imagettftext($background, 10, 0, 54, 81, $color, 'arial.ttf', $data);
// HTTPS Only port  443
//Makes and breaks the image
imagepng($background);
imagedestroy($background);
//Makes and breaks the image
?>