Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $base_url = $_SERVER['DOCUMENT_ROOT'] . '/RedSparrowTech/counter/';
- $style = 'web1';
- $ext = 'png';
- $min_digits = 5;
- $log_file = $base_url . 'counter.txt';
- $style_dir = $base_url . $style . '/';
- if (file_exists($log_file))
- {
- $unique_list = file($log_file);
- $unique_count = count($unique_list);
- if (!(in_array($_SERVER['REMOTE_ADDR'] . "\n", $unique_list)))
- {
- if ($funique = fopen($log_file, "a"))
- {
- fwrite($funique, $_SERVER['REMOTE_ADDR'] . "\n");
- fclose($funique);
- }
- else
- {
- echo "error opening logfile";
- }
- $unique_count++;
- }
- if ($min_digits > 0)
- {
- $digits = sprintf('%0' . $min_digits . 's', $unique_count);
- }
- $len = strlen($unique_Count);
- for ($x = 0; $x < $len; $x++)
- {
- $my_image = imagecreatefrompng( $style_dir . $style . '/' . $unique_list[$x] . '.png')
- header("Content-type: image/png");
- echo imagepng($my_image);
- }
- imagedestroy($my_image);
- exit;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement