• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Website views

This is the counter:
PHP:
Page views: <b><?php
					$views = file_get_contents('usercounter.dat');
					$views = explode(';', $views);
					foreach($views as $view)
						$i += 1;
						
					echo $i - 1;
				?></b>

Create a file called usercounter.dat.
 
This is the counter:
PHP:
Page views: <b><?php
					$views = file_get_contents('usercounter.dat');
					$views = explode(';', $views);
					foreach($views as $view)
						$i += 1;
						
					echo $i - 1;
				?></b>

Create a file called usercounter.dat.

That will not work o.O

Here, I made one for you which count unique hits:
PHP:
<?php
$filename = 'visits.txt';

$file = file($filename);
$file = array_unique($file);
$hits = count($file);
echo $hits;

$fd = fopen ($filename , "r");
$fstring = fread ($fd , filesize ($filename));
fclose($fd);
$fd = fopen ($filename , "w");
$fcounted = $fstring."\n".getenv("REMOTE_ADDR");
$fout= fwrite ($fd , $fcounted );
fclose($fd);
?>

How to use:
1. Put the script where you want the visit number to appear.
2. Make the file visits.txt
3. You are done...
 
Back
Top