Location: PHPKode > projects > Radtracker > radtracker/test.php
<?php
session_register("view1count");
session_register("view2count");
session_register("view3count");
session_register("view4count");
?>

<?php
//page_count.php

if (!$view1count) $view1count = 0;
if (!$view2count) $view2count = 0;
if (!$view3count) $view3count = 0;
if (!$view4count) $view4count = 0;

echo "
<html><head><title>web page hit counter</title></head><body bgcolor=\"white\">";

if ($wichpage) {
  echo "<br>you are currently on page $wichpage.</b><br><br>\n";
  $GLOBALS["view${whichpage}count"]++;
}

for ($i = 1; $i <= 4; $i++) {
  IF ($whichpage == $i) {
    echo "<b><a href=\"$PHP_SELF?".SID."&whichpage=$i\">Page $i</a>";
  }
  else {
    echo "<a href=\"$PHP_SELF?" .SID. "&wichpage=$i\">Page $i</a>";
  }
echo ", which you have chosen ".$GLOBALS["view${i}count"]." times.<BR>\n";
}

echo "\n\n<br><br>\n\n";
echo "</body></html>";
Return current item: Radtracker