Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.

Closed Thread
Thread Tools Display Modes
Share |
Old 07-13-2014, 07:34 AM
smsabbir480 smsabbir480 is offline
Junior Member
Join Date: 03-19-14
Posts: 23
iTrader: 0 / 0%

PHP (hypertext pre processor) has changed the way of web development.Now-a-days we can develop web applications easily by PHP.It has made web developing easier.Now i am presenting an page counter made by php.Sometime in our website we want to see that how many times our webpage is viewed.So this page counter will help to do so.Here is the page counter script.

PHP sorce script:
PHP Code:
//open the file for reading
$counter fread($fpfilesize($filename));
$counter $counter 1;
echo”<b>Total page Viewers:.$counter.</b>;

At first create a ‘txt’ file by ‘notepad’ or ‘notepad++’ in the xampp/htdocs folder and name it ‘counter.txt’.then inside the ‘counter.txt’ file write ’1′ and save it.
After this copy this copy the PHP code and save it in the same directory where the ‘counter.txt’ file is located.After that implement the saved PHP code in your web page.Hope this will work.



Old 07-16-2014, 12:12 AM
george.markou13's Avatar
george.markou13 george.markou13 is offline
Contributing Member
Join Date: 10-30-13
Location: athens
Posts: 106
iTrader: 0 / 0%
Better use session, so it wont count every time, the same person refreshes the page.
Old 07-16-2014, 06:30 AM
snakeair snakeair is offline
Super Moderator - Rest in Peace 2018
Join Date: 12-31-07
Location: Medford, NJ
Posts: 54,771
iTrader: 3 / 100%
This was asked already.

Next time give credit when you steal content.

Go Back   Webmaster Forum > Web Development > Coding Forum

Closed Thread

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Online Users Counter with No Bandwidth Consumption UnP0ssible Coding Forum 11 04-18-2011 05:53 PM
Problem with simple page counter using PHP and mySQL AdrianC Coding Forum 1 03-12-2011 10:47 PM
Embed Simple viewer in DW template page lajones3 Coding Forum 4 07-21-2007 05:35 PM
Can't see Flash Image Viewer once page is uploaded lajones3 Coding Forum 2 11-29-2006 03:39 PM
Page Hit Counter alvinzxx Coding Forum 2 11-21-2006 10:48 PM

V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory

All times are GMT -7. The time now is 07:36 PM.
Powered by vBulletin
Copyright © 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC