Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder adarshakb's Avatar
    Join Date
    Jun 2009
    Location
    Silicon valley of india
    Posts
    247
    Thanks
    11
    Thanked 1 Time in 1 Post

    Number of page hits

    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?
    Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.

    Albert Einstein
    -----------------------------------------------------
    My Blog songs

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by adarshakb View Post
    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

  • #3
    Regular Coder adarshakb's Avatar
    Join Date
    Jun 2009
    Location
    Silicon valley of india
    Posts
    247
    Thanks
    11
    Thanked 1 Time in 1 Post
    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?
    Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.

    Albert Einstein
    -----------------------------------------------------
    My Blog songs

  • #4
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by adarshakb View Post
    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

  • Users who have thanked oesxyl for this post:

    adarshakb (10-22-2009)

  • #5
    Regular Coder adarshakb's Avatar
    Join Date
    Jun 2009
    Location
    Silicon valley of india
    Posts
    247
    Thanks
    11
    Thanked 1 Time in 1 Post
    Quote Originally Posted by oesxyl View Post
    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 [lol as i said]

    For Php5/Apache2 is there any such software?
    thanks
    Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.

    Albert Einstein
    -----------------------------------------------------
    My Blog songs

  • #6
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by adarshakb View Post
    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 [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

  • #7
    Regular Coder adarshakb's Avatar
    Join Date
    Jun 2009
    Location
    Silicon valley of india
    Posts
    247
    Thanks
    11
    Thanked 1 Time in 1 Post
    Quote Originally Posted by oesxyl View Post
    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

    My thanks to the forum for helping me do that and solving my problems
    Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.

    Albert Einstein
    -----------------------------------------------------
    My Blog songs


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •