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
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).

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.