hi everyone ,
this problem is driving me crazy i've spent 4 hours and still didn't know the cause, the problem is the visited counter add to although the Mysql query is +1 only i've even tried to printed to check and it do +1 bu the counter get it 2....
do refresh and see the visited: in the file details.
here is the page code :
PHP Code:
<?php
/* HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH *\
--------------------------------------------------------------------------------
# #
# P.V. SHARE v1.0 #
# System Copy Type : FULL COPY #
# P.V. SHARE COMPANY - www.pvshare.com #
# Last Modify : 01/04/09 #
# ----------------------------------------------------------- #
# FILE CONTENT : #
# using this file the the visitors can play the files on the #
# the system. #
# #
---------------------------------------------------------------------------------
\* HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH */
# including the configuration files and all needed functions files
require_once("includes/config.php");
# SET THE GOLBALES FOR THE SYSTEM
# ------------------------------------------------------
# the defualt variables for the templates in the system
global $vars;
# the settings from the config.php file
global $setting;
# get the file details and check by type if the file should be treated as video, sound or image
$query = "SELECT * FROM `files` WHERE `id` = '". $_GET['fileid'] ."'";
$result = mysql_query($query);
if(!$result)
reportError("script index :: viewfile.php :: Error 104", mysql_error(), $query);
# build the file details template
$viewfiletemp['FILEDETAIL'] = buildPage($filevars, 'filedetail');
# choose how to treat the file. To add another file type tp treat as video, sound or image
# just add || ($file->extention == "EXAMPLE") to the condition where to treat the file as
$treatas = "other";
# Capture the original size of the uploaded image
list($width,$height) = getimagesize($filevars['FILEURL']);
# For our purposes, I have resized the image to be
# 600 pixels wide, and maintain the original aspect
# ratio. This prevents the image from being "stretched"
# or "squashed". If you prefer some max width other than
# 600, simply change the $newwidth variable
$filevars['HIEGHT'] = ($height/$width)*$filevars['WIDTH'];
# SET THE USER NAME
$nickname = getnickname($commentvars['USERID']);
$commentvars['NICKNAME'] = "<a href='member.php?nickname=". $nickname ."' target='_self'>". $nickname ."</a>";
# show the file comments
$viewfiletemp['FILECOMMENT'] .= buildPage($commentvars,'filecomments');
}
# check if the user is allowed to add comment
# using his / her group id to get the group details
# if so show the post comment form
if(grouppostcomment(usergroupfromuserid($userid))) {
"UPDATE `files` SET `visited` = visited+1 WHERE `id` = ". $_GET['fileid'];
That it updates the database as 2 pagehits?
I can't read that page, sorry I'm English illiterate much less any foreign language.
Question:
Have you checked your server logs to see how many hits this page has? Sometimes a spider will go through all the links on your page real fast, and if you have a page with a link to itself, then the spider will hit it a few times. This will result in multiple page hits that happen at the same exact second. I've had some that hit the page 3 and 4 times?