Simple PHP Image Counter by Hunje Cho
Download
View Source (print view)
Rating : 4.7
Views : 414
<?
/*
image font counter
icount.php3 / by Hunje Cho (vishnu76@dreamwiz.com)
$bgColor : Background Color , Hexadecimal
$fgColor : Foreground Color , Hexadecimal
Hexadecimal order : RGB (each 2byte)
*/
define("COUNT_FILE", "count.txt");
define("COUNT_FONT", "2");
function ConvertColor($hexVal)
{
$ColorVal = array(3);
for($i = 0; $i < 3; $i++)
$ColorVal[$i] = HexDec(substr($hexVal, $i * 2, 2));
return $ColorVal;
}
function addCount()
{
$fp = fopen(COUNT_FILE, "r");
$count = fgets($fp, 10);
fclose($fp);
$count++;
$fp = fopen(COUNT_FILE, "w");
fputs($fp, $count , 10);
fclose($fp);
return $count;
}
$strCount = addCount();
$width = strlen($strCount) * ImageFontWidth(COUNT_FONT);
$hImg = ImageCreate($width, ImageFontHeight(COUNT_FONT));
list($red, $green, $blue) = ConvertColor($bgColor);
$clrBg = ImageColorAllocate($hImg, $red, $green, $blue);
list($red, $green, $blue) = ConvertColor($fgColor);
$clrFg = ImageColorAllocate($hImg, $red, $green, $blue);
ImageFill($hImg, 1, 1, $clrBg);
ImageString($hImg, COUNT_FONT, 1, 1, $strCount, $clrFg);
header("Content-type: image/gif");
ImageGIF($hImg);
ImageDestroy($hImg);
?>
read mysql field, security, snnap_ss, salars77, paper_without_wood, guest, enfactuation, rent a car, download, regirstration form, php_snips, fedex, call php', userstatusinonline, php_script"_class="neww"_target="_blank"_title="im_neuen, best ide, php script" class="neww" target="_b..., forum, p t test paired, php_tools, href php function