I know your IP

in #steemit8 years ago

You can copy and paste this simple PHP code some.php file and upload to your hosting:

// Setting header content-type:
header('Content-Type: image/png');

// Setting variables:
$width = 1600;
$height = 900;
$font = './bebasneue_regular.ttf'; // path to font

// Getting IP from $_SERVER valiable:
$ip = $_SERVER['REMOTE_ADDR'];

//Simple counter of hosts:
$cnt = file_get_contents('./w.txt');
$cnt++;
file_put_contents('./w.txt', $cnt);
$cnt_text = "Page watched $cnt times";
// Creating image
$im = imagecreatetruecolor($width, $height);

// Setting colors:
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);

// Filling image:
imagefilledrectangle($im, 0, 0, $width - 1, $height - 1, $white);

// Writing IP with shadow
imagettftext($im, 270, 0, 31, 501, $grey, $font, $ip); // shadow
imagettftext($im, 270, 0, 30, 500, $black, $font, $ip);

// Writing counter information
imagettftext($im, 135, 0, 31, 701, $grey, $font, $cnt_text);
imagettftext($im, 135, 0, 30, 700, $black, $font, $cnt_text);

// Exporting PNG image
imagepng($im);

// Destroying
imagedestroy($im);

Sort:  

Sorry, steemit replaced file url

Coin Marketplace

STEEM 0.21
TRX 0.20
JST 0.034
BTC 99331.95
ETH 3298.98
USDT 1.00
SBD 3.05