Simple Visitor Counter Using php
Simple Visitor Counter Using php
This tutorial require 1 PHP file and 1 table of mySQL database.
1. counter.php
2. Database “mypage” and table “counter” with 1 fields: visitor(Int, 11). You need to insert a first one record with “0”.
Counter.php
Source Code
< ?php // For using session variables put this function on the top. session_start(); // Connect database mysql_connect("localhost","",""); mysql_select_db("mypage"); /* Check for session variable "visitor". If not exist, update database and create this session by Session ID.*/ if(!session_is_registered("visitor")){ $visitor=session_id(); session_register("visitor"); // Update value in column "all_visitor" by +1. mysql_query("update counter set visitors=visitors+'1'"); } ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Counter</title> </head> <body> Counter : < ? // Select data from easy_counter and put them into $result. $result=mysql_query("select * from counter"); $row=mysql_fetch_assoc($result); // Output all_visitor record. echo $row['visitors']; // Close database connection. mysql_close(); ?> </body> </html>Simple Visitor Counter Using php,
Incoming search terms:
- jquery visitor counter script (23)
- jquery visit counter (22)
- jquery counter visitors (16)
- jquery visitor count (10)
- php count visitors (3)
- jquery counter (2)
- no of visits count in php using session (1)
- jquery count visitors (1)
- how to count online visitor in web site in php (1)
- jquery page view counter (1)
- php code to count and display online visitors (1)
- jquery site visit counter plugin (1)
- jquery user online counter (1)
- jquery view counter (1)
- page visitor counter in php mysql (1)
- online visitors counter jquery (1)
- Online visitors counter (1)
- jquery visitor counter script php (1)
- jquery visitor online (1)
- nag counter php (1)
- javascript code counter for one person visits (1)
- if(counter==1) in jquery (1)
- how to update the visitors hits in mysql using php (1)
- count visitors to a website using html (1)
- Counter & visitor php (1)
- counter php and mysql (1)
- counter using mysql 2013 (1)
- counter using php (1)
- counter visitors simple php (1)
- create a nag counter on php with 5 time limit (1)
- create a simple cookie view counter (1)
- create visit counter php jquery (1)
- creating a visit counter in a cookie in php (1)
- creating javascript nag counter (1)
- hit counter in php jquery (1)
- how to code for visitors count no using php (1)
- how to count visits to site php (1)
- how to create a nag counter using php (1)
- how to create a php cookie with a nag counter (1)
- how to display online visitors on page with ajax (1)
thank you very much….
your good..
omg, you tell me to create a table ‘counter’ with one column ‘visitor’
but your query set visitorS=visitorS+’1′ :\
thanks for your help though