Hits Counter

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hits Counter

    I added this code to my login page
    $counter_array = file("counter.dat");
    $all = $counter_array[0]+1;
    $fp = @fopen("counter.dat","wb");
    @fputs($fp,$all);
    @fclose($fp);

    echo '
    Total hits: '.$all.'
    ';



    But got the following error

    Warning: file(counter.dat): failed to open stream: No such file or directory in /home/******/public_html/login.php on line 21

    Can anyone tell me how to fix it please ..Many thanks Tz

    #2
    your counter.dat file is missing in ur dir
    Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

    <span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">BEST MOBILE ADVERTISER</span></span>

    Comment


      #3
      thanks, i gathered that much but dont know how to create a file for it

      Comment


        #4
        just open notepad then save as counter.dat then upload

        Comment


          #5
          Code:
          echo "Site Hits: ";
          $fp=fopen("count.txt","a+"); fputs($fp,"1"); fclose($fp); $fp1=filesize("count.txt");
          echo "$fp1";
          make a new file and call it count.txt and cmod it to 777 and it will count hits for you.

          Comment


            #6
            Thank you, I will give that a go, ..one other thing what doe cmod77 mean ?

            Comment


              #7
              have you worked it out yet?.. lol

              Comment


                #8
                or try this.
                http://www.2wap.org/forums/index.php?autom...ail&f_id=55
                http://ngeo.ro

                Comment


                  #9
                  No not yet

                  Comment


                    #10
                    $counter_array = file("counter.dat");
                    $all = $counter_array[0]+1;
                    $fp = @fopen("counter.dat","wb");
                    @fputs($fp,$all);
                    @fclose($fp);

                    echo &#39;
                    Total hits: &#39;.$all.&#39;
                    &#39;;


                    its working fine.. you can upload this.... hope your prob will be solve after this

                    Comment


                      #11
                      Thank you i will give that a go

                      Comment


                        #12
                        Its working now , Thank you

                        Comment

                        Working...
                        X