PHP-Web-Stat Support Forum
https://www.php-web-statistik.de/cgi-bin/yabb/YaBB.pl
Board (English) >> English board >> Feature request: Use of domain names to exclude
https://www.php-web-statistik.de/cgi-bin/yabb/YaBB.pl?num=1653180932

Beitrag begonnen von John Motyer am 22.05.22 um 02:55:32

Titel: Feature request: Use of domain names to exclude
Beitrag von John Motyer am 22.05.22 um 02:55:32
Hello Reimar & Holger,

I don't know how easy or difficult it would be to add this capability in a future release, but where now under Advanced | General, where currently users can Exclude IP Addresses, it would be nice to be able to also add domain names.

Please let me explain why.  I am currently running phpWebStat on each of my 16 hobby websites, and I currently have my external IP added to be excluded from logging.  The problem is my external IP from my ISP occasionally gets reset to a new IP without me knowing about the new IP, often for many weeks, and during that time my own access to my sites end up being logged.  I know that I can set the cookie for each site that phpWebStat is running on to not log my own visits, but often I need to reset such things as my browser cache & sometimes cookies, requiring me to remember to enable the cookies for each site to not log my own visits again.

I use a DDNS (No-IP) to monitor my external IP changes, so my 16 domain names always point to my external IP even after it changes.  With the capability to use domain names to be excluded, my external IP can change to a new IP address without me having to worry about updating phpWebStat on each of my sites :).

Just a thought.

Thank you in advance & have yourself a great day.

Regards,
John

Titel: Re: Feature request: Use of domain names to exclude
Beitrag von Reimar am 24.05.22 um 10:01:05
Hi John,

we think we have a nice solution for you.
If you want to exclude your own visits from getting tracked, we place a little php-file on the desired domain, that is setting a coookie and forwards you to the homepage again. So, if you place the following code within a single file, e.g. "my-cookie.php" and bookmark this file (www.example.com/my-cookie.php), you can safely visit your page without getting tracked.

Here is the code:


Code (php):
<?php
//------------------------------------------------------------------------------
if ( ( !isset ( $_COOKIE ['dontcount'] ) ) || ( $_COOKIE ['dontcount'] != 'ja' ) )
{
  setcookie ( 'dontcount', 'ja', time()+3600*24*365*5 , '/' );
  header    ( 'Location: /.' );
}
else
{
  header    ( 'Location: /.' );
}
//------------------------------------------------------------------------------
?>


You can adjust the last line (header) with a page you want to forward to. If you want to read the manual regarding this function, just google "php header location".

Best wishes
Reimar

Titel: Re: Feature request: Use of domain names to exclude
Beitrag von John Motyer am 24.05.22 um 10:02:54
Much appreciated for the suggestion, I'll give it a try.

PHP-Web-Stat Support Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2012. Alle Rechte vorbehalten.