RE: [PHP] Newbie question: Page Counter
then make a file called count.inc and chmod it to 777 so anyone can write to it. insert a number into the file. Hey! I tried to make this counter.php-file, that went ok, I think My problem is to make the count.inc-file, I could make it but I have no idea how to put "chmod" to "777" in it. The number I am supposed to insert in the file is that just how many that has allready visited or what is it? And, it's just to insert a number, because I'd like it to allready have the number that's on the counter I have today... /Marthe -- 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] Newbie question: Page Counter
chmod is a *nix command. you do it to the file: chmod 777 counter.inc on the command line -jack -Original Message- From: Marthe Kristiansen [mailto:[EMAIL PROTECTED]] Sent: Friday, April 20, 2001 3:04 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Newbie question: Page Counter then make a file called count.inc and chmod it to 777 so anyone can write to it. insert a number into the file. Hey! I tried to make this counter.php-file, that went ok, I think My problem is to make the count.inc-file, I could make it but I have no idea how to put "chmod" to "777" in it. The number I am supposed to insert in the file is that just how many that has allready visited or what is it? And, it's just to insert a number, because I'd like it to allready have the number that's on the counter I have today... /Marthe -- 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] Newbie question: Page Counter
make one yourself: a table with the data you want to store, on every hit you insert there info, including Unique Session ID. then use simple SQL queries to read your stats. also see http://www.phpbeginner.com/columns/McDonald/counter there's an idea for beginners on how else it could work.. Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: Marthe Kristiansen [mailto:[EMAIL PROTECTED]] Sent: Friday, April 20, 2001 11:08 AM To: Php-General Subject: [PHP] Newbie question: Page Counter Hey! I'm a bit new at PHP, my page's at http://www.marthe.com. My problem is that the counter on the page, from TheCounter.com, is far too ugly. Since I'm updating the page, I'm wondering if anyone has any good ideas on how I should make one and what I should do. Greetings, Marthe -- 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] Newbie question: Page Counter
make a file called counter.php and include this text: //-counter.php-- ---// ?php //Simple PHP counter, v0.1. Send comments to [EMAIL PROTECTED] if (file_exists('count.inc')) { $fil = fopen('count.inc', r); $dat = fread($fil, filesize('count.inc')); echo $dat+1; fclose($fil); $fil = fopen('count.inc', w); fwrite($fil, $dat+1); } else { $fil = fopen('count.inc', w); fwrite($fil, 1); echo '1'; fclose($fil); } php? //-- --// then make a file called count.inc and chmod it to 777 so anyone can write to it. insert a number into the file. //--count.inc--- --// some value //-- --// then all u have to do is include the line: ?php include (counter.php) ? into the page you want a counter hope this helps :) i use this script myself -Adam -- 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]