Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * +--------------------------------------------------------------+
- * | Volkova Online Checking |
- * +--------------------------------------------------------------+
- * | |
- * | Author: Ryan |
- * | Version: 0.02 |
- * | |
- * | This version also needs a base image, in this example it is |
- * | "Image.png" that is being used |
- * +--------------------------------------------------------------+
- */
- error_reporting(0); //If you can not connect to the url you get an error, so by turning error reporting off, you avoid this.
- $name = "Ryan";
- $url = "2.126.10.113:80";
- function get_url_contents($url){
- $crl = curl_init();
- $timeout = 3;
- curl_setopt ($crl, CURLOPT_URL,$url);
- curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
- $ret = curl_exec($crl);
- curl_close($crl);
- return $ret;
- }
- $str = get_url_contents($url);
- $im = imagecreatefrompng("image.png");
- if(!$im) { die("Image Niggered up");}
- $black = imagecolorallocate($im, 0, 0, 0);
- $green = imagecolorallocate($im, 121, 212, 121);
- $red = imagecolorallocate($im, 209, 62, 62);
- $font = 1;
- $length = strlen($name) + 5; // The "+ 5" is the " is: "
- $length = $length * 6;
- imagestring($im,$font,5, 5,"$name is: ",$black);
- if ( $str ) {
- imagestring($im, $font, $length, 5, "Online", $green);
- } else {
- imagestring($im, $font, $length, 5, "Offline", $red);
- }
- Header('Content-type: image/png');
- imagepng($im);
- imagedestroy($im);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment