Forum Moderators: open

Message Too Old, No Replies

server side include

how to include a file from a different folder

         

Farout

10:11 pm on Nov 22, 2004 (gmt 0)

10+ Year Member



I would like to use ssi to get some tabels on multible pages in subfolders, but I cant seem to get it to load from a higher folder.

works fine with <!--#include file="tabel.php" --> when tabel.php is in the same folder.
Is there any simple way to include a file from the root folder on pages in several subfolders?

Thanks

Lance

10:15 pm on Nov 22, 2004 (gmt 0)

10+ Year Member



On IIS it would be:
<!--#include virtual="/tabel.php" -->

Birdman

10:16 pm on Nov 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sure! Just add a slash:

<!--#include file="/tabel.php" -->

The slash indicates that the base path will start at root, whereas no slash will set the base path at the current directory.

Lance

10:19 pm on Nov 22, 2004 (gmt 0)

10+ Year Member



On IIS, if you add a /slash you also have to change file= to virtual=.

Birdman

10:48 pm on Nov 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Good call Lance. I haven't done IIS in years.

Farout

11:03 pm on Nov 22, 2004 (gmt 0)

10+ Year Member



Thanks a lot guys "virtual" did the trick :)
<!--#include virtual="/tabel.php" -->

Lance

11:08 pm on Nov 22, 2004 (gmt 0)

10+ Year Member



Any time...

Glad we could help.