Announcement

Collapse
No announcement yet.

php includes

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

  • php includes

    how can I make the "includes" directory so that no one can download from it, nor can anyone access it directly? Only PhP programs that "include" it should be able to access it
    Real Web Host

  • #2
    Originally posted by webhost
    how can I make the "includes" directory so that no one can download from it, nor can anyone access it directly? Only PhP programs that "include" it should be able to access it
    Well if you didn't want to mess with .htaccess or other apache stuff, what you could concievably do is set a check at the beginning of the file like so.

    PHP Code:
    if ($includevar!=1) {
        exit;

    Then just tell scripters to add
    PHP Code:
    $includevar=1
    before they require or include the files.

    Comment


    • #3
      Originally posted by webhost
      how can I make the "includes" directory so that no one can download from it, nor can anyone access it directly? Only PhP programs that "include" it should be able to access it
      The best way to protect this directory is to place it outside of your document tree. Browsers have no chance to access anything outside of your document tree, but your php-scripts on your server do.

      -----------------
      http://www.trendfish.de

      Comment


      • #4
        Still it's not the safest way. Maybe an .htaccess file would help?

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        X