Php > Graphics
GDLib Hit Counter
GDLib Hit Counter tag into //your code calling this file e.g.
//Declare filename $file = "counter.txt"; //read data from file declared $data = file($file); //increment counter value from file by one $data[0]++; //write new counter value to file $fileout = fopen($file, "w+"); fwrite ($fileout, $data[0]); fclose($fileout); //Assign each digit from declared file to different variable name $num1 = substr($data[0],0,1); $num2 = substr($data[0],1,1); $num3 = substr($data[0],2,1); $num4 = substr($data[0],3,1); //Declare background image Header("Content-type: image/jpeg"); $image = ImageCreateFromJPEG("background.jpg"); //Add first image to backround image $icon = ImageCreateFromJPEG("$num1.jpg"); $width = ImageSX($icon); $height = ImageSY($icon); ImageCopyResized($image,$icon,25,52, 0,0,$width,$height,$width,$height); //Add second image to backround image $icon = ImageCreateFromJPEG("$num2.jpg"); $width = ImageSX($icon); $height = ImageSY($icon); ImageCopyResized($image,$icon,62,53, 0,0,$width,$height,$width,$height); //Add third image to backround image $icon = ImageCreateFromJPEG("$num3.jpg"); $width = ImageSX($icon); $height = ImageSY($icon); ImageCopyResized($image,$icon,93,52, 0,0,$width,$height,$width,$height); //Add forth image to backround image $icon = ImageCreateFromJPEG("$num4.jpg"); $width = ImageSX($icon); $height = ImageSY($icon); ImageCopyResized($image,$icon,128,51, 0,0,$width,$height,$width,$height); //return new image ImageJPEG($image); //remove new image from memory ImageDestroy($image); ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage