/[health_html]/inc/tracker.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /inc/tracker.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Wed Sep 19 12:23:57 2001 UTC (22 years, 6 months ago) by ravilov
Branch: MAIN
Added thefilez/med/ (PLIVAmed site). Other major changes...

1 ravilov 1.1 <?php
2     $ref = $HTTP_SERVER_VARS["HTTP_REFERER"];
3     $idx = strpos($ref, "?");
4     if (!($idx === false)) $ref = substr($ref, 0, $idx);
5     $tgt = $HTTP_SERVER_VARS["SERVER_NAME"]."/".$HTTP_SERVER_VARS["REQUEST_URI"];
6     $idx = strpos($tgt, "?");
7     if (!($idx === false)) $tgt = substr($tgt, 0, $idx);
8     include("inc/conn.php");
9     $sth = $dbh->prepare("SELECT count FROM tracker WHERE (referer = '$ref') AND (target = '$tgt')");
10     $row = "";
11     if ($sth) {
12     if ($sth->execute()) $row = $sth->fetchrow_array();
13     $sth->finish();
14     }
15     if ($row) $sql = "UPDATE tracker SET count = count + 1 WHERE (referer = '$ref') AND (target = '$tgt')";
16     else $sql = "INSERT INTO tracker (referer, target, count) VALUES ('$ref', '$tgt', 1)";
17     $dbh->dbh_do($sql);
18     $dbh->disconnect();
19     ?>

  ViewVC Help
Powered by ViewVC 1.1.26