Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder saeed's Avatar
    Join Date
    Oct 2002
    Location
    West Yorkshire
    Posts
    343
    Thanks
    32
    Thanked 0 Times in 0 Posts

    Hit Count problem.

    Hello,
    I downloaded a hit count script ... did some modifications ... its working fine on one of my domain but other one is showing me some errors... although am getting results below the errors..

    Working fine

    Working fine with some errors

    additionally, I want to know how can i use it as includes ... I wont be copying script on every page.

    Script contains two files .. counter.php and count.txt

    herez the code.
    PHP Code:
    <? 
    $filename 
    "count.txt";
    $fp=fopen("$filename","r");
    $count=fread($fpfilesize("$filename")); 
    fclose($fp); 
    $count++; 
    $fp=fopen("$filename","w+"); 
    fwrite($fp,$count); 
    fclose($fp); 
    echo 
    "This website has been accessed <sub>$count</sub> times.";
    ?>
    any help will be appreciated.

    thanks,

    Saeed.
    Don't click on this!

    #!/usr/bin/saeed

  • #2
    New Coder
    Join Date
    Apr 2007
    Location
    India
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    click count or hit count

    GemGuy

    Be friend of me
    Hey what a fun

  • #3
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts

    Netscape

    Quote Originally Posted by saeed View Post
    Hello,
    I downloaded a hit count script ... did some modifications ... its working fine on one of my domain but other one is showing me some errors... although am getting results below the errors..

    Working fine

    Working fine with some errors

    additionally, I want to know how can i use it as includes ... I wont be copying script on every page.

    Script contains two files .. counter.php and count.txt

    herez the code.
    PHP Code:
    <? 
    $filename 
    "count.txt";
    $fp=fopen("$filename","r");
    $count=fread($fpfilesize("$filename")); 
    fclose($fp); 
    $count++; 
    $fp=fopen("$filename","w+"); 
    fwrite($fp,$count); 
    fclose($fp); 
    echo 
    "This website has been accessed <sub>$count</sub> times.";
    ?>
    any help will be appreciated.

    thanks,

    Saeed.
    it gives you a clue, Permission denied
    try
    PHP Code:
    chmod("/counter/count.txt"0755); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •