in reply to How to prevent database from listing/viewing?

One solution is to put the data "outside" the directories that the webserver displays, e.g. if your script is in /var/www/cgi-bin/, put the data in /var/lib/myapp/.
  • Comment on Re: How to prevent database from listing/viewing?

Replies are listed 'Best First'.
Re^2: How to prevent database from listing/viewing?
by santander (Acolyte) on Dec 03, 2004 at 15:56 UTC
    One of the possible way is add one or two lines of code, that will handle "empty requests"(running script with no requests), for example, when running the script with no requests set 0 to display all the database or 1 to display the $no_matches_found message. my $default_show_mode = 0;

    But dont know how to implement this, as well what do with database.txt listing.
Re^2: How to prevent database from listing/viewing?
by santander (Acolyte) on Dec 03, 2004 at 15:45 UTC
    If I put data outside the cgi-bin, I will need rewrite scipt, since it will looks data in'standard' place(i dont know how do this). What I have is index.html page placed in cgi-bin folder, it prevents from direct access to cgi-bin directory, but can no prevent from mentioned listing.
      Maybe I'm misunderstanding, but I'd expect the only line you'd have to change is:
      my $CSV_file = "/the/path/to/the/database.txt";
        Yes, I understand now, just one line.