diff --git a/README b/README deleted file mode 100644 index ea27ded..0000000 --- a/README +++ /dev/null @@ -1,13 +0,0 @@ -Do-Not-Track demo site ------------------------------------------------ -SUMMARY: This site tracks users (every time the "tracking" image is encountered -on other parties' web sites), and when they arrive at this page, it shows them -where they've been. This demo has a cookie-based Opt-Out system, but also -honors the "DNT: 1" header as an equivalent "don't track me" option. - -DEVELOPER: Sid Stamm - -NOTES: -* When installing, be sure to copy the config/config.default.php to - config/config.php and set the variables appropriately - diff --git a/config/config.default.php b/config/config.default.php deleted file mode 100644 index cd3e39a..0000000 --- a/config/config.default.php +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/config/schema.sql b/config/schema.sql deleted file mode 100644 index 7a811ad..0000000 --- a/config/schema.sql +++ /dev/null @@ -1,11 +0,0 @@ --- --- Table structure for table `tracked_sessions` --- - -CREATE TABLE IF NOT EXISTS `tracked_sessions` ( - `tracking_id` varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'tracking cookie value', - `referrer` varchar(1024) COLLATE utf8_unicode_ci NOT NULL COMMENT 'location of beacon', - `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'when the beacon was loaded', - PRIMARY KEY (`time`) -); - diff --git a/dnt_status.php b/dnt_status.php index eb47038..8e49680 100644 --- a/dnt_status.php +++ b/dnt_status.php @@ -1,7 +1,5 @@ Mozilla: Do Not Track - + - - + + - + - - + + diff --git a/optout.php b/optout.php deleted file mode 100644 index 138531c..0000000 --- a/optout.php +++ /dev/null @@ -1,33 +0,0 @@ -prepare("DELETE FROM tracked_sessions WHERE tracking_id LIKE ?"); - $stmt->bindParam(1, $cky); - $stmt->execute(); - $dbh = null; -} -// opt-out for a month. -setcookie($cfg['cookiename'], 'optout', time()+2592000); -?> - - - -Do-Not-Track Example Application - - - - - -

Do-Not-Track Example Application OPT OUT

-

You've been successfully opted out of tracking via our opt-out cookie. If you're not returned to the main page shortly, click here to get there.

- - diff --git a/results.php b/results.php deleted file mode 100644 index 47cce27..0000000 --- a/results.php +++ /dev/null @@ -1,49 +0,0 @@ - - - -DNT tracking data - - - -prepare("SELECT referrer, time FROM tracked_sessions WHERE tracking_id LIKE ? ORDER BY time DESC"); - $stmt->bindParam(1,$cky); - $stmt->execute(); - - print(""); - foreach ($stmt->fetchAll() as $row) { - ?> - - - - - prepare("DELETE FROM `tracked_sessions` WHERE to_days(now()) - to_days(`time`) > 7"); - $stmt->execute(); - $dbh = null; -} -?> - - diff --git a/track.php b/track.php deleted file mode 100644 index d1e06f1..0000000 --- a/track.php +++ /dev/null @@ -1,49 +0,0 @@ -prepare("DELETE FROM tracked_sessions WHERE tracking_id LIKE ?"); - $stmt->bindParam(1, $cky); - $stmt->execute(); - $dbh = null; -} elseif(isset($cky) and $cky == "optout") { - //opted out via cookie. Do nothing (don't log the request) -} else { - //user didn't opt out, so log the hit. - if(!isset($cky)) { - $value = base64_encode(rand(1000000000,9999999999)); - setcookie('trackingcookie', $value, time()+3600000); - } - //log $cky -> ref - $dbh = new PDO($cfg['dbconnectstring'], $cfg['dbuser'], $cfg['dbpassword']); - $stmt = $dbh->prepare("INSERT INTO tracked_sessions (tracking_id, referrer) VALUES (?, ?)"); - $stmt->bindParam(1, $cky); - $stmt->bindParam(2, $ref); - $stmt->execute(); - $dbh = null; - -} - - -// then, serve the appropriate image. -header("Content-Type: image/png"); -if($dnt) { - readfile("images/dnt-big-on.png"); -} else { - readfile("images/dnt-big-off.png"); -} -?>