Author Topic: Relative Paths  (Read 3409 times)

0 Members and 1 Guest are viewing this topic.

Offline steveeyes

  • Full Member
  • ***
  • Posts: 177
    • View Profile
Relative Paths
« on: February 25, 2007, 05:40:47 PM »
I guess I don't understand what relative is. Hopefully someone can show me the way.

I have a folder in my includes directory called forum and a file called 4menu2.php. The path to that folder is:

http://www.asian-wife.net/include/fourm/4menu2.php.

I created a new template file called forum.html and included the following include command in the template.

<?php
include($_SERVER['DOCUMENT_ROOT']."/include/forum/4menu2.php");
?>

The forum.html file is located at: http://www.asian-wife.net/tempates/blue/forum.html

When I  execute my new template I use the following:

http://www.asian-wife.net/index.php?template=forum

I get the following errors:

Code: [Select]
Warning: Unknown(/home/asianlad/public_html/asian-wife-net/include/forum/4menu2.php): failed to open stream: No such file or directory in /home/asianlad/public_html/asian-wife-net/includes/template.php(101) : eval()'d code on line 81

Warning: Unknown(/home/asianlad/public_html/asian-wife-net/include/forum/4menu2.php): failed to open stream: No such file or directory in /home/asianlad/public_html/asian-wife-net/includes/template.php(101) : eval()'d code on line 81

Warning: (null)() [function.include]: Failed opening '/home/asianlad/public_html/asian-wife-net/include/forum/4menu2.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/asianlad/public_html/asian-wife-net/includes/template.php(101) : eval()'d code on line 81

I tried different paths with the include command but no success.


I'm sure it is because I don't understand relative paths. Boy, do a google on relative path and you get pages of elaboration that confuses you more than helps.

Hopefully someone can tell me what the correct relative path is for my include command. It would be appreciated.

Thanks
Steve


I did read Chris's mod at: http://www.4homepages.de/forum/index.php?topic=4295.msg17676#msg17676, but for dummies like me it didn't help since I didn't understand my relative path.

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: Relative Paths
« Reply #1 on: February 25, 2007, 09:46:36 PM »
Why not just edit the forum template, so it looks like the forum?

Or you could make it load in a iframe. But that's not that smart

Offline steveeyes

  • Full Member
  • ***
  • Posts: 177
    • View Profile
Re: Relative Paths
« Reply #2 on: February 25, 2007, 10:24:50 PM »
Bart

That didn't help. I'm hoping someone can help me understand what my relative path would be.

Thanks