bx93 0 Report post Posted October 5, 2004 Most counter were realized with files. Here I suggest another solution which use php and mysql.A file named welcome.php contains the following code:<?php function welcome(){ $query= "update webcount set count=count+1;"; mysql_query($query); $query= "SELECT count FROM webcount;"; $result = mysql_query($query); $row = mysql_fetch_row($result); return $row[0]; }?>in index.php file,require the welcome.php at the first place.<?phprequire("welcome.php");?><html>....</html>show the count:<?php echo welcome(); ?>There is some benefit we may get from this solution, though current version support only one counter in the system, but you could easily change it to multi-counter version which could used to count every page in the site or provide counter to the others. Share this post Link to post Share on other sites
Loser 0 Report post Posted October 5, 2004 I probably sound like a n00b, but I ask why to use MySQL in it? Share this post Link to post Share on other sites
k221405241470 0 Report post Posted October 5, 2004 Not each provider gives a Free-Sql Account , Isn't bettere to use a simple page with the number of the visitors? Share this post Link to post Share on other sites
bx93 0 Report post Posted October 6, 2004 Not each provider gives a Free-Sql Account , Isn't bettere to use a simple page with the number of the visitors? <{POST_SNAPBACK}> Yeah, there is really a little more complex if we want to provide others with MySql counter. When I designing the multi-version counter, I found that every time, there should be database connection and close task, which may not so fast than operations on files. What you mentioned maybe more important is that the counter provider should has the MySql access, thanks Xisto.com, but it is difficult to find when hosting at other place. Anyway, I agree with your suggestion. Share this post Link to post Share on other sites