-
Web page info stats
I would like to know how many times a web page has been visited.
I do not require a visible hit counter but maybe more along the lines of php file maybe ?
I would add each web page url to the file in question and each time a page is loaded update the figure next to the url etc.
It doesn't need to be fancy at all but have it to sort the order from most to least hits.
Example.
Url example a 13
Url example e 11
Url example c 9
Url example b 4
Url example d 0
OR
I did think about having a hit counter on each page but make it invisible & only to be shown when you mouse over a wild card etc on the page & mouse off would make it hidden again.
The wild card could even be a small jpg box which would be the same colour as its background so it doesn't stand out and I would know where it was to view the counter.
Or to use on click function.
What do you think ?
-
Why not use Google Analytics?
Or look through the scripts here http://www.hotscripts.com/category/s...ipts-programs/
-
This is what i would like to incorporate into my pages.
http://www.rxs-enterprises.org/fp/ar...t_Counter.aspx
-
ok,forget the above.
I have looked at the link you supplied and found that this item looks like what i need.
http://www.hotscripts.com/listing/an...phpagecounter/
Just need help with the following info.
$website="www.wgrep.com"; //Your website here
$rp =$_SERVER['PHP_SELF'];
$ip =$_SERVER['REMOTE_ADDR'];
$counter_host = "localhost"; //your mysql server
$counter_user = "root"; //your mysql username
$counter_pass = ""; //your mysql password
$counter_database = "counter"; //your mysql database
-
What exactly do you need help with?
-
Not sure what to put where it shows your mysql server.
I have done the others,is that something you can check to see if its correct
?
-
The mysql server is the server that your database is stored on. It could be "localhost", or an IP address like "127.0.0.1", or something like "db.webhost.com" - depends how your web host is set up. You should be able to find this information in your host control panel, otherwise, ask your web host.
-
Its localhost.
But just dont understand the instructions to set it up.
Its written as if you know all the lingo to start with.
I have unziped the files into a folder called counter and uploaded them.
I have added the details for server,username etc.
Now stumped.
1) unzip all files to a directory I called counter
2) Then Install the database named counter
then use the code below to create the table.
3) Edit counter.php changing the values to your server and mysql details
you can also modify the output strings if necessary.
4) Then to run as a sitewide counter at the top of
every page, point the auto prepend part of php.ini to counter.php
comment out the include ((( //include ("../counter/counter.php"); ))) at the top
of count.php, zerocounter.php, and del,php.
example:((( auto_prepend_file="c:/inetpub/wwwroot/counter/counter.php" )))))
OR
4) The counter can be called on a per page only basis by uncommenting the include at the top of
count.php, zerocounter.php, and del,php and including counter.php in the page
example ((( include ("../counter/counter.php"); )))
5) the script count.php is the administration page you can modify or delete specific pages
6) email me if you find this useful.
7) the number images should be replaced with your own these are provided as examples only.
-
It looks like you just need to do step 4 - the second one (I'm assuming you're on shared hosting so it's unlikely that you will be able to openly edit your php.ini file or be allowed to upload a custom one to your root folder, so ignore the first step 4)
So open the 3 advised files (count.php, zerocounter.php, and del.php) and uncomment the include command at the top of the files.
Then you add the advised PHP counter include at the top of the web pages you want to track (right at the top - before any whitespace or Doctype), making sure the path to the counter is right. You may need to include the opening and closing PHP tags too;
Code:
<?php include ("../counter/counter.php"); ?>
Bear in mind that this is a PHP script so it runs on web pages ending .php
If yours aren't .php web pages, you can rename them and setup 301 redirects in .htaccess (if your web host permits .htaccess) to avoid destroying your SEO and indicate to search engines that the pages have moved http://301redirects.net/301-redirect...extensions.php
OR you can configure .html/.htm pages to parse PHP (if your server permits it and if you're allowed to edit your .htaccess file) http://stackoverflow.com/questions/4...n-as-php-files
If these method don't work, Google for alternatives or speak to your web host.
-
Thanks for the help but i must stop there as im getting deeper and deeper into unknown waters.
I will sort something out and start a new post i think.
Thanks so far