Jump to content

php Include Question


jaminb2030

Recommended Posts

Having a small issues with include, my dir is

 

dir.JPG

 

Address: http://angellyceum.aohelp.info

File locations: http://angellyceum.aohelp.info/include/menu.php

                      http://angellyceum.aohelp.info/submit/sell/back.php

 

Iv got

		<?

include("../include/menu.php");
?>

 

Im trying to get back.php to include menu.php

Iv had no problems with it on files that are http://angellyceum.aohelp.info/folder/file.php

 

Im assuming there some way that i can include menu.php from a file 2 folders in but so far iv been googlling for an hour and have had no luck and im out of ideas..

 

Link to comment
https://forums.phpfreaks.com/topic/194975-php-include-question/
Share on other sites

try:

include("../../include/menu.php");

 

the ".." means "go up one directory" so ../../ means go up two, or ../../../ means go up three etc.

 

The other option is:

include("/include/menu.php");

 

By putting the "/" at the beginning you are using an absolute filepath (include("/file.php") will include http://mysite.com/file.php)

 

Remember that your menu may not work if the files it links to are relative to files in the Angellyceum folder. I would make sure that the menu.pgp uses absolute values (with the / at the front).

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.