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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.