PDA

View Full Version : php include


whl626
12-06-2004, 12:55/12:55PM
I discover something about the SSI ( server side include ), and want to confirm with anyone if my understanding about SSI is correct.

Say there is a file.txt in this folder /abc/file.txt and there is a .htaccess with this line ' deny from all ' inside it ( /abc/.htaccess ).

If I save another file as .php with such script inside -

<?php if (file_exists(abc/file.txt)) { include(abc/file.txt); }

The result is the php file successfully include the file.txt.

But if I use

<!--#include virtual="abc/file.txt" -->

The result is ' error processing the document ', it seems that .htaccess blocks the include taking place. But with php include it GETs BY.

Is that the case ? Hope I made myself clear :)

JasonMichael
10-01-2005, 01:31/01:31AM
I don't know about SSI, but I can say that PHP 'gets by' with its own include because it isn't governed by your .htaccess parameters, other than those specified for PHP.