simpele-counter-voor-website
Gesponsorde koppelingen
PHP script bestanden
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$file = "ip.txt";
$aLines = file($file);
$iAantal = count($aLines);
$sContent = " ";
if ($iaantal >1000) // het aantal IP adressen wat het script bewaard.
{
$sContent = " ";
$fp = fopen($file, 'w');
fwrite($fp, $sContent);
fclose($fp);
}
$content = file_get_contents("$file");
if(strstr($content, $ip)){
echo "Welkom terug " . $ip;
}
else {
$echo = 1;
echo "Hallo " . $ip . "," . "<br>" . "dit is u eerste bezoek aan deze website en u bent bezoeker NR ";
if(!strstr($content, $ip)){
$file = fopen ("$file","a");
fputs ($file, "$ip \r\n");
fclose($file);
}
if (file_exists("counter.txt")) {
$fp = fopen("counter.txt", "r+");
$count = fgets($fp, 6);
$count++;
rewind ($fp);
fputs($fp, $count, 6);
fclose($fp);
} else {
$fp = fopen("counter.txt", "w");
$count="1";
fputs ($fp, $count, 6);
fclose($fp);
}}
if ($echo != 1)
{
echo "<br>" . "U bent bezoeker ";
}
include ('counter.txt')
?>
$ip = $_SERVER['REMOTE_ADDR'];
$file = "ip.txt";
$aLines = file($file);
$iAantal = count($aLines);
$sContent = " ";
if ($iaantal >1000) // het aantal IP adressen wat het script bewaard.
{
$sContent = " ";
$fp = fopen($file, 'w');
fwrite($fp, $sContent);
fclose($fp);
}
$content = file_get_contents("$file");
if(strstr($content, $ip)){
echo "Welkom terug " . $ip;
}
else {
$echo = 1;
echo "Hallo " . $ip . "," . "<br>" . "dit is u eerste bezoek aan deze website en u bent bezoeker NR ";
if(!strstr($content, $ip)){
$file = fopen ("$file","a");
fputs ($file, "$ip \r\n");
fclose($file);
}
if (file_exists("counter.txt")) {
$fp = fopen("counter.txt", "r+");
$count = fgets($fp, 6);
$count++;
rewind ($fp);
fputs($fp, $count, 6);
fclose($fp);
} else {
$fp = fopen("counter.txt", "w");
$count="1";
fputs ($fp, $count, 6);
fclose($fp);
}}
if ($echo != 1)
{
echo "<br>" . "U bent bezoeker ";
}
include ('counter.txt')
?>