Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Location
    Singapore
    Posts
    1,032

    Can .htaccess do this?

    Hello,

    I am attempting a work around for some of the scripts that I have and basically is .htaccess able to

    1) Generate a log file of what files have been requested when someone enters that folder
    2) Then give vales or print the file name in that "log" file

    then could a php script

    1) look into that log file
    2) get the sizes of the files
    3) add them up
    4) access a SQL datable to a specific table and locate the ID associated to the log file
    5) write to a column where taking the original value and then adding the current
    6) After that prune the log file.

    I can't seem to find the coding for .htaccess to produce the file and log each file access...

    Thanks for any advice.
    -=- GQ Hong -=-
    GalacNet WebMaster

  2. #2
    Join Date
    Mar 2004
    Location
    Greater Chicagoland
    Posts
    181
    I don't know if you can create a log out of a .htaccess file. One option though would be to simply have PHP read your main access log. You could use Grep (or an equivalent PHP function if one exists) to limit the results to files in the directory your concerned about.

    Another option would be to install the SQL log module for Apache. This allows for your Apache logs to be stored in a SQL database. In this case your PHP script has a much easier time working with the data since all of the data is already in a database.

  3. #3
    Join Date
    Jan 2004
    Location
    Singapore
    Posts
    1,032
    Humm.. interesting
    I will go and look at the options.

    Thanks
    -=- GQ Hong -=-
    GalacNet WebMaster

Posting Permissions

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