php出力ページカウンタピクチャ
961 ワード
<?php
// GD2
$im = imagecreate(240, 24); //
$gray = imagecolorallocate($im, 200, 200, 200); //
$color = imagecolorallocate($im, rand(0,255), rand(0,255), rand(0,255)); //
$text = iconv("gb2312", "utf-8", " "); //
$font = "Fonts/FZHCJW.TTF";
imagettftext($im, 14,0,20,18,$color,$font,$text); //
imagestring($im, 5, 160, 5, $counter, $color); //
imagepng($im); // png
imagedestroy($im); //
//
if($_POST){
$filename = "../filterwords.txt";
if(is_writeable()){
$file = fopen($filename, 'r+');
}else{
echo " ".$filename." ";
}
fseek($file, 0, SEEK_END);
$word = $_POST[txt_word];
fwrite($file, $word);
fwrite($file, '\r
';);
fclose($file);
}