A graph counter that uses sessions. This is a graph counter made of Sessions. after a user logs on, the counter is added. only when the browser is closed and re-opened will the counter be added. The counter written by SESSION, session_start (this is a graph counter made by SESSION. after a user logs on, the counter is incremented by one, and the counter is incremented only when the browser is closed and re-opened.
// Counter written with SESSION,
Session_start ();
If (session_is_registered (count) = false ){
While ($ fp = fopen ("counter.txt", "r +") = false );
While (flock ($ fp, 3) = false );
$ Count = fgets ($ fp, 255 );
$ Count + = 1;
Fseek ($ fp, 0 );
Fputs ($ fp, $ count );
Fclose ($ fp );
Session_register (count );
}
$ Len = strlen ($ count );
For ($ I = 1; $ I <= 6-$ len; $ I ++)
{
$ Imagpath = ""; // TEMP is the image folder. The image file name must be 0. GIF... 9.GIF.
}
For ($ I = 1; $ I <= $ len; $ I ++)
{
$ Imagpath. = "";
}
Print "you are the first". $ imagpath. "bits ";
?>
Bytes. // Counter written in SESSION, session_start (...