0

I have written this code for page hits cout
its working perfectly ok on my pc
but when i uploaded it on my site it show error any body help me in this issue

<?php
$cnt = "hits.txt";
$h = @fopen($cnt, 'r') or die("can't open file");
$x=@fread($h,10);
$h1 = @fopen($cnt, 'w') or die("can't open file");
$x+=1;
echo "Page Hits:".$x;
fwrite($h1,$x);
fclose($h1);

?>

link to page is http://wasimmalik.freewebhostx.com/pagehit.php
error is
Warning: fopen(hits.txt) [function.fopen]: failed to open stream: Permission denied in /www/freewebhostx.com/w/a/s/wasimmalik/htdocs/pagehit.php on line 5
can't open file|
need ur help
thanks in advance

2
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by wasimmalik
0

Check the file read/write/execute permissions after you uploaded the file.

/Michael

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.