#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Indonesia
    Posts
    87
    Rep Power
    14
    I have a few question here .

    I make a script in PHP for a visitor counter.
    I used a file called it <b> counter.dat </b>
    I read from this file and update it.

    I set the permission of counter.dat as
    rwxrw-rw- (it should be like that, isn't it ??)

    I realize that any other users in my server can modified that file.

    And my question is :
    just think that this file is very important and nobody should be able to modified it.

    What should I do ???
    Some people said that no other way beside using database. Is it ?

    Somebody have a better solution beside using a database ???

    Thx !
    See ya



    ------------------
    ** It's the world of Oscario **
  2. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    Assuming your web server is apache and it's run as nobody/nogroup.

    >>rwxrw-rw- (it should be like that, isn't it ??)
    It should be rw-rw-rw- (666)

    >>I realize that any other users in my server can modified that file

    Right

    >>Some people said that no other way beside using database. Is it ?

    Yes.

    >>Somebody have a better solution beside using a database ???

    Probably no. But hey, ask yourself how important such counter.dat is. Why people wanna alter your counter.dat in the first place? I am sure you have alot more important file to worry about. If I were the bad guy, I would mess up your other files instead. counter.dat seems less important to me. If you don't like that host, just switch host and find a host that supports suEXEC.


    [This message has been edited by freebsd (edited August 20, 2000).]
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Niteroi, RJ, Brazil
    Posts
    30
    Rep Power
    14
    Another solution:

    --- counter.dat.html ---
    <?php
    //
    632
    ?>
    --- counter.dat.html ---

    Like this, you just get the second line, strip the first 3 chars and then rewrite, etc. If someone access gets a blank page.

    You can try this...

    ------------------
    Eduardo Teixeira Cardoso
    PHP Programmer from Brazil
    idnotfound@vircio.com.br
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Indonesia
    Posts
    87
    Rep Power
    14
    IdNotFound...
    I don't get what you mean .

    Would you please explain it once again ?

    Or anybody else can explain it to me ??

    See ya

    ------------------
    ** It's the world of Oscario **

Similar Threads

  1. help with tables and wordwrapping
    By junkedBrian613 in forum PHP Development
    Replies: 2
    Last Post: February 15th, 2004, 05:42 PM
  2. Loading data from text files
    By Manso in forum MySQL Help
    Replies: 1
    Last Post: January 28th, 2004, 04:53 AM
  3. how to keep table on top, not centered??
    By vinyl in forum HTML Programming
    Replies: 2
    Last Post: January 20th, 2004, 06:19 PM
  4. float question
    By yeah-yeah in forum HTML Programming
    Replies: 10
    Last Post: January 15th, 2004, 03:59 PM
  5. Javascript scrollbar - stuck on last bit
    By NayMyoSan in forum JavaScript Development
    Replies: 0
    Last Post: January 3rd, 2004, 12:05 PM

IMN logo majestic logo threadwatch logo seochat tools logo