![]() |
Visit counter site in PHP
In this article, I'll demonstrate how to create a very simple-counter for a web (WebCounter).
First of all, prepare the database - more accurately, create the necessary tables. The table name will be "counter" and will have two columns: "id" - number of records to be added and automatically zoom in for each record in a table and "address" - IP addresses of visitors. To do this, use the following SQL code (maybe you know where it is contracting;)): Code: SQL Code:
CREATE TABLE counter (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, address VARCHAR (15))Code: PHP
Do not forget to connect to database server (mysql_connect ('server', 'user', 'pass')), and select the database (mysql_select_db ('db_name')). Of course, this simple code can be extended to - You can add there a last visit func, or counter of the views, etc. P. S. I apologize for the terrible grammar ..., I had no time to correct it :( Stay tuned for the further Articles! |
Re: Visit counter site in PHP
Quote:
|
Re: Visit counter site in PHP
Quote:
PS: Thanks for editting my articles ... |
Re: Visit counter site in PHP
@Scripting
good first try, if you work on it or try something a bit different he might except it as an article. of course you need to post them in them here http://www.go4expert.com/forumdisplay.php?f=1 |
Re: Visit counter site in PHP
Quote:
|
Re: Visit counter site in PHP
Nice code . Please add ";" after the last echo line :)
|
| All times are GMT +5.5. The time now is 07:46. |