jesushax Posted July 31, 2008 Share Posted July 31, 2008 hi here is my vistor coutner code <?php $count_my_page = ("".$_SERVER['DOCUMENT_ROOT']."/includes/counter.txt"); $hits = file($count_my_page); $hits[0] ++; $fp = fopen($count_my_page , "w"); fputs($fp , "$hits[0]"); fclose($fp); echo $hits[0]; ?> i get these error messages Warning: fopen(C:\Websites/includes/counter.txt) [function.fopen]: failed to open stream: Permission denied in C:\Websites\constructionworks\includes\counter.php on line 5 Warning: fputs(): supplied argument is not a valid stream resource in C:\Websites\includes\counter.php on line 6 Warning: fclose(): supplied argument is not a valid stream resource in C:\Websites\includes\counter.php on line 7 1 2 questions: 1. is this script any good, i just want a simple how many vistors ive had id like to have a page that just says Vistors Unique Vistors : 123456 This Month Vistors: 123456 Total Visitors: 123456 if someone could point me to a script this simple or perhaps show me one you have previosuly created that would be great 2. What permissons do i have to set to these files, as i have to get my host to do it Thankyou Quote Link to comment Share on other sites More sharing options...
ronnie88 Posted July 31, 2008 Share Posted July 31, 2008 set chmod 777 then see what you get who do you have as your host all you should have to do is login to ftp and right click and go to chmod.....unless you have host where they don't let you access anything for your counter check this one out http://inobscuro.com/tutorials/read/30/ Quote Link to comment Share on other sites More sharing options...
jesushax Posted July 31, 2008 Author Share Posted July 31, 2008 thanks im gonna try that one out do i set the folder to chmod 777 or the specific files? thanks Quote Link to comment Share on other sites More sharing options...
ronnie88 Posted July 31, 2008 Share Posted July 31, 2008 should be just the counter.txt Quote Link to comment Share on other sites More sharing options...
jesushax Posted July 31, 2008 Author Share Posted July 31, 2008 what about in the files you gave me a link to, i want to use that counter instead is it the ip.db count.db ? THanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.