...

View Full Version : Number of page hits



adarshakb
10-22-2009, 02:52 PM
I had a doubt. New to handling with files using php. SO to count the number of users who view my page i did a program which read a file containing the number.. incremented it and wrote back to it the updated number..
My question is that it works if many users don't hit my website. But what happens when 2 users try to access simultaneously my website?.. For obvious reasons i could'nt emulate the problem..

or is this the wrong way to approach the problem?

oesxyl
10-22-2009, 03:09 PM
I had a doubt. New to handling with files using php. SO to count the number of users who view my page i did a program which read a file containing the number.. incremented it and wrote back to it the updated number..
My question is that it works if many users don't hit my website. But what happens when 2 users try to access simultaneously my website?.. For obvious reasons i could'nt emulate the problem..

or is this the wrong way to approach the problem?
yes is wrong because you already have all information in the server logs. Better then trying to write something from scratch is to use a package like awstat, webalizer, or others.

best regards

adarshakb
10-22-2009, 03:15 PM
thks. Didnt know it was in the server log. If its so how do i access it?
i suppose i have to use $_SERVER[] variable?

oesxyl
10-22-2009, 03:22 PM
thks. Didnt know it was in the server log. If its so how do i access it?
i suppose i have to use $_SERVER[] variable?
no, it's a file on the server. First look at this:

http://awstats.sourceforge.net/

this is a package that do what you want to do.
To analize server logs is a difficult task, :)

best regards

adarshakb
10-22-2009, 03:58 PM
no, it's a file on the server. First look at this:

http://awstats.sourceforge.net/

this is a package that do what you want to do.
To analize server logs is a difficult task, :)

best regards

I had a look. But found that it need perl thingy.. i run Apache 2 and Php and do my coding and since i am new and have to learn in limited time i am a bit reluctant to tinker with it :P i googled for similar apache/php thingy softwares...[i still fully dont grasp the awstats idea cos i havent tried] found some.. dono what they are:rolleyes: [lol as i said]

For Php5/Apache2 is there any such software?
thanks

oesxyl
10-22-2009, 04:43 PM
I had a look. But found that it need perl thingy.. i run Apache 2 and Php and do my coding and since i am new and have to learn in limited time i am a bit reluctant to tinker with it :P i googled for similar apache/php thingy softwares...[i still fully dont grasp the awstats idea cos i havent tried] found some.. dono what they are:rolleyes: [lol as i said]

For Php5/Apache2 is there any such software?
thanks
if you have apache you have also perl, :)
I use awstat I don't know how other package work. A sort search with google for "php log analizer" give me as first link this one:

http://sourceforge.net/projects/phploganalyze/

as I said I don't know it, if you are unsatified with it choose other, :)
As a personal opnion I don't think php is the proper language for this job, :)
What do you intend to do? why the language is important?

best regards

adarshakb
10-22-2009, 05:04 PM
if you have apache you have also perl, :)
I use awstat I don't know how other package work. A sort search with google for "php log analizer" give me as first link this one:

http://sourceforge.net/projects/phploganalyze/

as I said I don't know it, if you are unsatified with it choose other, :)
As a personal opinion I don't think php is the proper language for this job, :)
What do you intend to do? why the language is important?

best regards

well my intension is basically to create a website with full user account/access permissions/blogs/statistics on web traffic and user preferences. And i need to create it fast for a project. So asked in this very forum. Few suggested PhP. Started to right away learn it. So i am intent on sticking on to it to avoid delays in completion. I am sure other scripting languages are equally good or more.. but found PhP is very simple and found a good tutorial too from the forum links :)

i will raise another great doubt i have in me in another thread.. please point me in the right direction there cos thats very important :p

My thanks to the forum for helping me do that and solving my problems:thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum