Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<?php
session_start();
function hitcount($page) {
$page = "'" . substr($page,0) . "'" ;
if (!isset($_SESSION[$page])) {
$_SESSION[$page] = true;
$db = mysql_connect("mysql_server", "username", "password");
mysql_select_db("db_name", $db);
$sql ="SELECT * FROM counter WHERE pageid=$page";
$result = mysql_query($sql);
$dbrow = mysql_fetch_array($result);
// check if any value was returned then update or new
if (is_null($dbrow[2])) {
$sql = "INSERT INTO counter (pageid,hitcount) VALUES ($page,1)";
} else {
$dbrow[2] = $dbrow[2] + 1;
$sql = "UPDATE counter SET hitcount='$dbrow[2]' WHERE pageid = $page";
}
$result = mysql_query($sql);
$count = $dbrow[2];
mysql_close($db);
return $count;
}
}
?>
<?php
include('include/sqltrack.php');
$count = hitcount($_SERVER['PHP_SELF']);
?>
<?php
include('include/sqltrack.php');
$count = hitcount($_SERVER['PHP_SELF']);
?>
<?php
include('include/sqltrack.php');
$count = hitcount($prodID);
?>