Created
August 26, 2015 06:21
-
-
Save Momijinn/4c75e024ea55eab2e175 to your computer and use it in GitHub Desktop.
アクセスしてきた人のIPアドレスなどを取得してjpegに書き込む
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$ip = $_SERVER['REMOTE_ADDR']; | |
$ag = $_SERVER['HTTP_USER_AGENT']; | |
$rh = gethostbyaddr($_SERVER['REMOTE_ADDR']); | |
$dt = date("Y/m/d H:i:s"); | |
$gz = imagecreatetruecolor(1100, 180); | |
$col = imagecolorallocate($gz, 255, 0, 0); | |
//jpegに文字を書き込み | |
imagestring($gz, 8, 20, 30, "=Your_Address=", $col); | |
imagestring($gz, 8, 20, 50, $dt, $col); | |
imagestring($gz, 8, 20, 70, "IP_Address: ".$ip, $col); | |
imagestring($gz, 8, 20, 90, "USER_AGENT:", $col); | |
imagestring($gz, 8, 40, 110, $ag, $col); | |
imagestring($gz, 8, 20, 130, "REMOTE_HOST: ".$rh, $col); | |
//jpegの作成 | |
imagejpeg($gz, "Your_Address.jpg"); | |
//jpegメモリの開放 | |
imagedestroy($gz); | |
//jpegの表示 | |
print "<IMG SRC='Your_Address.jpg'>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
phpでアクセスしてきた人のIPアドレス、利用しているブラウザ情報などを読み込みJPEGにして表示するプログラムをつくりました。