[PHP] Re: PHP page counter
Hello Vedanta, Thanks for the Link, I have registered and downloaded. I will test it. Thanks again Michelle Am 2005-09-12 10:33:52, schrieb Vedanta Barooah: there is one here : http://www.phpclasses.org/browse/package/2212.html see if it suffices your need, thanks, vedanta - END OF REPLYED MESSAGE - -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSM LinuxMichi 0033/3/8845235667100 Strasbourg/France IRC #Debian (irc.icq.com) signature.pgp Description: Digital signature
[PHP] PHP page counter
G'Morning *, Does anyone know, where I can get a PHP-Code for a high performance page counter ? I need one, which can handle very high traffic (15.000 Hits/h) becase my own one sucks (locking). :-/ It can be text/plain or php-gd based. Greetings Michelle -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSM LinuxMichi 0033/3/8845235667100 Strasbourg/France IRC #Debian (irc.icq.com) signature.pgp Description: Digital signature
Re: [PHP] PHP page counter
there is one here : http://www.phpclasses.org/browse/package/2212.html see if it suffices your need, thanks, vedanta On 9/11/05, Michelle Konzack [EMAIL PROTECTED] wrote: G'Morning *, Does anyone know, where I can get a PHP-Code for a high performance page counter ? I need one, which can handle very high traffic (15.000 Hits/h) becase my own one sucks (locking). :-/ It can be text/plain or php-gd based. Greetings Michelle -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSM LinuxMichi 0033/3/8845235667100 Strasbourg/France IRC #Debian (irc.icq.com) -- *~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~* -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A PHP page counter / statistics app
on 01/03/03 7:27 AM, Michael Zornek ([EMAIL PROTECTED]) wrote: I'm ether looking to find or build my own open source php based script, that would allow you to include a small code chunk on every page of a site and then view statistics from the info, on what pages were viewed, how many times, etc... First, if there are any you know of and want to recommend, please post. Secondly, if I do build it myself would it be better to write this log to file or mysql db? Right now I only get like 200 page views a day but still am concerned about resource use since I'm on a shared server. It depends how detailed you you want it broken down by: - page - page and month - page and week - page and day - page and hour - page and minute - page and second Personally, I have two tables: counters_page (id, url) counters_hits (page_id, stamp) My counters.inc script does the following: - looks to see if the current URL is already listed in counters_page - if it is, it grabs the id - if not, it inserts and creates a new id - inserts a record into counters_hits with the page_id, and a unix timestamp of when that page was hit. This way, I know the exact second that a page was hit... So I can perform report on that data, selecting how many hits for each page within the last week, month, year, minute, 30 seconds, etc etc. This *IS* a little expensive in terms of data storage though. Each hit to the site costs around 20 bytes. A site I recently launched has attracted 37,000+ hits, so we're already looking at 740k of data. However, this table layout IS more economic than recording the entire URL of each hit... instead we only record the id of the URL. If I were only concerned with days, or months, I'd choose to store less data (and may still!!)... for example, a current timestamp is 10 chars long, wheras storing 2003-03 is only 7 chars (but only cares about the month, not the day, hour, minute, second, etc). The key issue with the above design is NOT how long it takes to record the data (I have never noticed any performance hit on my code, even on a very busy shared server). It seems to be (although not drastic AT ALL) at the point where I choose to report. It's a LOT of information to plow through, and it will get worse :) There are plenty of things I can do though... I can archive reports, I can cache queries, I can perform monthly analysis, etc etc. To me, the most important factor is the data, and I know I've got exactly what I want. You may also wish to know things like what browser they're using, their IP address, etc etc, which may be a key reason why you should build your own. I choose to build my own for the following reasons: 1. learn learn learn 2. keep it tightly integrated with my other admin tools 3. get exactly what I want Also check out: http://www.phpbuilder.com/columns/index.php3?cat=5subcat=32 (logging category) Finally, can you call a php script from an ServerSideInclude page?? not sure, but you should check the archives for server side includes and ssi Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A PHP page counter / statistics app
I'm ether looking to find or build my own open source php based script, that would allow you to include a small code chunk on every page of a site and then view statistics from the info, on what pages were viewed, how many times, etc... First, if there are any you know of and want to recommend, please post. Secondly, if I do build it myself would it be better to write this log to file or mysql db? Right now I only get like 200 page views a day but still am concerned about resource use since I'm on a shared server. Finally, can you call a php script from an ServerSideInclude page?? ~ Mike -- MikeZornek.com New blog, new QA column, new content everywhere! http://www.mikezornek.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: A PHP page counter / statistics app
Take a look here http://www.unf.edu/~hayg0001/php/pagetracker.php. I have a script that you can use as a starting point. It is nothing fancy, but it works. Every thing is stored in a database, where I can then produce real time reports for the site. ~Guy Haynes Michael Zornek wrote: I'm ether looking to find or build my own open source php based script, that would allow you to include a small code chunk on every page of a site and then view statistics from the info, on what pages were viewed, how many times, etc... First, if there are any you know of and want to recommend, please post. Secondly, if I do build it myself would it be better to write this log to file or mysql db? Right now I only get like 200 page views a day but still am concerned about resource use since I'm on a shared server. Finally, can you call a php script from an ServerSideInclude page?? ~ Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] page counter
I got an example from the internet about the PHP page counter. However after several testing on the coding, I still met the problem which I don't understand. Please help me. ? $counter_file = "/home/venus/public_html/qa/doccon/doc_distribution/count.txt"; $counter_file_line = file($counter_file); $counter_file_line[0]++; print "counter=$counter_file_line\n"; $cf = fopen($counter_file,"w"); fputs($cf, "$counter_file_line[0]"); fclose($cf); echo $counter_file_line[0]; ? problems: Warning: fopen("/home/venus/public_html/qa/doccon/doc_distribution/count.txt","w") - Permission denied in /home/venus/public_html/qa/doccon/doc_distribution/New.php on line 9 Warning: Unable to find file identifier 0 in /home/venus/public_html/qa/doccon/doc_distribution/New.php on line 10 Warning: Unable to find file identifier 0 in /home/venus/public_html/qa/doccon/doc_distribution/New.php on line 11 Thanks from: Wendy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] page counter
Warning: fopen("/home/venus/public_html/qa/doccon/doc_distribution/count.txt","w") - Permission denied in /home/venus/public_html/qa/doccon/doc_distribution/New.php on line 9 Check your permissions on the file. If its just a counter file, the easiest thing to do would be to make it world writeable. chmod 777 count.txt. you should then have the perms to write to it. -jack -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] page counter
Hi Wendy, @ 1:38:45 AM on 4/10/2001, Wen Ni wrote: I got an example from the internet about the PHP page counter. However after several testing on the coding, I still met the problem which I don't understand. Please help me. ... "/home/venus/public_html/qa/doccon/doc_distribution/count.txt"; ... Warning: fopen("/home/venus/public_html/qa/doccon/doc_distribution/count.txt","w") - Permission denied in /home/venus/public_html/qa/doccon/doc_distribution/New.php on line 9 The file: /home/venus/public_html/qa/doccon/doc_distribution/count.txt Has to be writable by the user the web server is running as. Typically www or nobody. -Brian -- PGP is spoken here: 0xE4D0C7C8 Please do not carbon copy me on list replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] page counter
Hi Jack, @ 2:44:51 AM on 4/10/2001, Jack Dempsey wrote: ... Check your permissions on the file. If its just a counter file, the easiest thing to do would be to make it world writeable. chmod 777 count.txt. you should then have the perms to write to it. 777 is world writable. Bad idea. Maybe not for a simple counter file, but I wouldn't get into the habit of doing that. -Brian -- PGP is spoken here: 0xE4D0C7C8 Please do not carbon copy me on list replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] page counter
Hi wen, Make sure that the counter file is readable by the user apache or user nobody which ever is your default webserver user. If it is not then just chown it to nobody or chmod it to 777 and you are done. Keyur - Original Message - From: "Keyur Kalaria" [EMAIL PROTECTED] To: "Wen Ni" [EMAIL PROTECTED] Sent: Tuesday, April 10, 2001 12:25 PM Subject: Re: [PHP] page counter Hi Make sure that the counter file is readable by the user apache or user nobody which ever is your default webserver user. If it is not then just chown it to nobody or chmod it to 777 and you are done. Keyur - Original Message - From: "Wen Ni" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 10, 2001 11:08 AM Subject: [PHP] page counter I got an example from the internet about the PHP page counter. However after several testing on the coding, I still met the problem which I don't understand. Please help me. ? $counter_file = "/home/venus/public_html/qa/doccon/doc_distribution/count.txt"; $counter_file_line = file($counter_file); $counter_file_line[0]++; print "counter=$counter_file_line\n"; $cf = fopen($counter_file,"w"); fputs($cf, "$counter_file_line[0]"); fclose($cf); echo $counter_file_line[0]; ? problems: Warning: fopen("/home/venus/public_html/qa/doccon/doc_distribution/count.txt","w") - Permission denied in /home/venus/public_html/qa/doccon/doc_distribution/New.php on line 9 Warning: Unable to find file identifier 0 in /home/venus/public_html/qa/doccon/doc_distribution/New.php on line 10 Warning: Unable to find file identifier 0 in /home/venus/public_html/qa/doccon/doc_distribution/New.php on line 11 Thanks from: Wendy -- -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] page counter
At 12:28 PM 10/04/2001, you wrote: Hi wen, Make sure that the counter file is readable by the user apache or user nobody which ever is your default webserver user. If it is not then just chown it to nobody or chmod it to 777 and you are done. The catch 22 is.. If you want security then its best to change the ownership to be the same as the webserver. But the problem is, if you dont have root permissions on the box, you cant change the ownership (or if you can, you cant change it back once its done). I have root access on the machines I work on so its not a problem, but a regular user may not have this ability to change it. Chris -- Chris Aitken - Webmaster/Database Designer - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 fax: +61 2 4628 8890 Unix -- because a computer's a terrible thing to waste! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] page counter
yes yes, bad habit i know ;-) but tis only a counter file... sometimes it probably is just better to explain the SLIGHTLY more complex solution in favor of starting a bad habit :-) all the best, jack Brian Clark wrote: Hi Jack, @ 2:44:51 AM on 4/10/2001, Jack Dempsey wrote: ... Check your permissions on the file. If its just a counter file, the easiest thing to do would be to make it world writeable. chmod 777 count.txt. you should then have the perms to write to it. 777 is world writable. Bad idea. Maybe not for a simple counter file, but I wouldn't get into the habit of doing that. -Brian -- PGP is spoken here: 0xE4D0C7C8 Please do not carbon copy me on list replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] page counter
In addition of all people said, I would add a lock to the file : $cf = fopen($counter_file,"w"); flock($cf,LOCK_EX); fputs($cf, "$counter_file_line[0]"); fclose($cf); This to avoid another script attempt to read the file while you update it... I had the problem, so sometimes the counter return to zero... jean-arthur At 13:38 10/04/01 +0800, Wen Ni wrote: I got an example from the internet about the PHP page counter. However after several testing on the coding, I still met the problem which I don't understand. Please help me. ? $counter_file = "/home/venus/public_html/qa/doccon/doc_distribution/count.txt"; $counter_file_line = file($counter_file); $counter_file_line[0]++; print "counter=$counter_file_line\n"; $cf = fopen($counter_file,"w"); fputs($cf, "$counter_file_line[0]"); fclose($cf); echo $counter_file_line[0]; ? problems: Warning: fopen("/home/venus/public_html/qa/doccon/doc_distribution/count.txt","w") - Permission denied in /home/venus/public_html/qa/doccon/doc_distribution/New.php on line 9 Warning: Unable to find file identifier 0 in /home/venus/public_html/qa/doccon/doc_distribution/New.php on line 10 Warning: Unable to find file identifier 0 in /home/venus/public_html/qa/doccon/doc_distribution/New.php on line 11 Thanks from: Wendy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] EuroVox 4, place Flix Eboue 75583 Paris Cedex 12 Tel : 01 44 67 05 05 Fax : 01 44 67 05 19 Web : http://www.eurovox.fr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Page Counter
Dear Friends, I want to do page counter for my web site and I wonder whether PHP can do it or not. I am new in PHP so can you all please give me some idea how to solve my problem. Thank a lot. regards, Wendy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Betr.: [PHP] Page Counter
Dear Wendy, Check out http://www.hotscripts.com/PHP/Scripts_and_Programs/ You should all you the scripts you'll need here!, still some problems? Let me know? Best regards, Maarten Verheijen MvG, Maarten Verheijen T/EXP kamernummer C558 Telefoonummer 4559 Wen Ni [EMAIL PROTECTED] 02-04-01 11:33 Dear Friends, I want to do page counter for my web site and I wonder whether PHP can do it or not. I am new in PHP so can you all please give me some idea how to solve my problem. Thank a lot. regards, Wendy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Page Counter
http://newbienetwork.net/sections.php?op=viewarticleartid=1 Read it, Learn it. Jason Lotito www.NewbieNetwork.net Where those who can, teach; and those who can, learn. -Original Message- From: Wen Ni [mailto:[EMAIL PROTECTED]] Sent: Monday, April 02, 2001 3:33 AM To: [EMAIL PROTECTED] Subject: [PHP] Page Counter Dear Friends, I want to do page counter for my web site and I wonder whether PHP can do it or not. I am new in PHP so can you all please give me some idea how to solve my problem. Thank a lot. regards, Wendy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]