Ok!
Thanks for reply! Where shall I do this? What kind of table do you mean? An ordinary html table for displaying the function? The problem is the function. Maybe I missunderstood. Im not very good in programming.
what is logic update?
Do you have any code example?
Tha code Im using right now is:
(but it dont work for counting the pageloads on each unique articles, it displays the total amount of pageloads)
Its a free script from www.adamarkdesign.com
<?php
/*
PHP Multipage Counter
Written by:
Adam Stout (Adam@adamarkdesign.com)
www.adamarkdesign.com
Version 1.5
11/25/00
To install insert this code into your PHP page:
$display="Yes"; include("counter/counter.php");
Be sure to change this to the relative location
of the script.
Set $display to yes or no to have counter display
or just print number in the code as a comment.
(If not set, defaults to yes)
Directory counter.php is in must have permissions
set to 777 on UNIX machine.
*/
$counterfile = $DOCUMENT_ROOT.'/counter/'.ereg_replace( "/", "_", $PHP_SELF);
if (!file_exists($counterfile)) {
// Start Counter at 5000
$count=4999; //Will get ++ before being printed
$initial = $count + 1;
// Success Message
echo "Congrats. Your Counter File Successfully Created.<BR>";
echo "Your counter has been initialized to $initial<BR>";
echo "To change the counter simply modify the counter file:<BR>";
echo "$counterfile<BR>";
}
else {
// Open Counter
//open the file handler
$fp=fopen("$counterfile","r");
//Read the previous count
$count=fgets($fp,1024);
//close the file.
fclose($fp);
}
$fw=fopen("$counterfile","w");
//Increment the counter
$pageviews=$count+1;
//write the counter back to the log file ie., acc.txt
$countnew=fputs($fw,$count+1);
//Display counter
if ($display != "No") {
echo $pageviews;
} else {
echo "<!-- This page has been viewed $pageviews times. -->";
}
fclose($fw);
?>
thanks
Perik