Forum Moderators: coopster

Message Too Old, No Replies

Template framework question

         

Doraemon

12:25 pm on Oct 15, 2003 (gmt 0)

10+ Year Member



Hi.

I have build a small site based on this Tutorial [phpbuilder.com]. It's a template framework, which does exactly what I want expect for one thing.
I cannot get this PHP script to accept sub-directories. At the moment all files have to be on root level in order to work.

Being a PHP newbie, I don't know how to change the code in order to make it work.

It'd be great if on of you could help me!

Thanks in advance! :)

jatar_k

5:03 am on Oct 16, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Is it just a root relative path problem? Have you taken a look at the paths it creates to access the directories? It could just be a simple bad path problem.

Doraemon

9:23 am on Oct 16, 2003 (gmt 0)

10+ Year Member



I guess it is.

But as I said, I have only very limited understanding of PHP and can just hack around in some scripts a little bit.
I fear, I even don't know how to direct the "require" command to a higher directory. In HTML it's ../, but how does that work in PHP?

Sorry for such rudimental questions.
Thanks!

coopster

12:04 pm on Oct 16, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



That is correct, Doraemon. Here are a few Unix commands/indicators regarding directory traversal:
  • (~) = Home directory (although recognized, generally should not be used)
  • / = Root directory
  • ../ = The directory that contains the current directory;
    you can combine and repeat the two periods and forward slash
    to reference any file on the server that you have access to

The PHP manual is loaded with information and proves to be a great resource. The online manual (and now the downloadable manual) includes User Contributions that can be very helpful as well. Visit [php.net...] and bookmark the manuals page, put it right next to WebmasterWorld in your Bookmarks ;)