
May 8th, 2008, 01:04 PM
|
|
Contributing User
|
|
Join Date: Apr 2008
Location: CDA, ID
|
|
OK. I took a nap then got up to think about it again. Here is what I came up with and am posting it just in the slightest chance it might help someone else. The session $title_slogan was previously set to determine this vehicle's page from another's, but you could create a var for any purpose.
PHP Code:
// SESSION BASED PAGE COUNTER **************************************************
if ( (!isset($_SESSION[$title_slogan])) || ($_SESSION[$title_slogan] != 'hit') ) {
call_mysqli();
$sql = "update " . TABLE_VEHICLES . "
set page_views = page_views +1
where vehicle_id = '{$_GET['vehicle_id']}'
";
if ($mysqli->query($sql)) {
$_SESSION[$title_slogan] = 'hit';
} // end if sql
$mysqli->close();
} // end if session
// END SESSION BASED PAGE COUNTER **********************************************
|