<?php

$live = "images/start.png";
$dead = "images/error.png";

$link = $_GET['link'].":";
$s_link = str_replace("::", ":", $link);
list($addr,$port)= explode (':',"$s_link");
if (empty($port)){
  $port = 3306;
}

$churl = @fsockopen(server($addr), $port, $errno, $errstr, 20);
             if (!$churl){
                header("Location: $dead");
                }
             else {
                header("Location: $live");             
      }
function server($addr){
         if(strstr($addr,"/")){$addr = substr($addr, 0, strpos($addr, "/"));}
         return $addr;
}
?>