Peppermint Tea

How to: Output Total Visits and Uniques on Your Website

Posted 7 February 2006 in Tips by Sam Brown -

I get asked this question a lot, and I saw that a topic at the Mint Forums about this exact thing was recently resurrected, I thought I would try and make it a little easier for everyone.

Step 1: Download & Edit

Download the connection script, open it up in any text editor and edit your Mint database details. You will need your username, password and database name that you use to let Mint connect to your database.

Step 2: Upload & Include

Upload the script to your website, it can go anywhere you like, even inside your /mint/ folder. Once you have uploaded the file include it at the very top of the page you want to display the total stats on:

< ?php require_once('mint/minttotals.php'); ?>

Step 3: Call either of the totals

Lastly, include these php variables where you would like to see the Total Visits:

< ?php echo $totalvisits; ?>

or, Total Unique Visits:

< ?php echo $totalunique; ?>

That is it!

Total Visits and Total Unique visits on your homepage. This script was written by Beau Collins and was published on the Mint Forums. All credit to Beau. Remember to remove the space at the start of the php lines