abdul bary
abdul bary

Reputation: 53

How to display number of visitors?

I have an application uploaded on a web server. I want to display the total number of visitors who have been to my application link. Any idea?

Upvotes: 0

Views: 1387

Answers (2)

adil
adil

Reputation: 1517

If you want to display visitors from data table from your server. Use php

$con=mysql_connect("localhost", "username", "password"); if (!$con)
{ die('Could not connect: ' . mysql_error()); } echo "Connected to MySQL
"; mysql_select_db("adil") or die(mysql_error()); echo "Connected to Database";

$result = mysql_query("SELECT * FROM test"); echo ""; while($row = mysql_fetch_array($result)) { echo "" . $row['visitor'] . "" . "" . $row['col2'] . ""; // echo "
"; } echo ""; mysql_close($con);

Upvotes: 0

Mehdi Karamosly
Mehdi Karamosly

Reputation: 5438

Check this code it uses cookie check and you can update parameters like for how long a visitor is considered unique :

http://discussion.accuwebhost.com/how-tos/479-how-write-simple-php-hit-counter-displays-number-visits-your-website.html

Upvotes: 1

Related Questions