Jump to content

vistor counter permissons


jesushax

Recommended Posts

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 :D

 

2. What permissons do i have to set to these files, as i have to get my host to do it

 

Thankyou

Link to comment
https://forums.phpfreaks.com/topic/117491-vistor-counter-permissons/
Share on other sites

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/

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.