jaminb2030 Posted March 12, 2010 Share Posted March 12, 2010 Having a small issues with include, my dir is 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.. Quote Link to comment https://forums.phpfreaks.com/topic/194975-php-include-question/ Share on other sites More sharing options...
aleX_hill Posted March 12, 2010 Share Posted March 12, 2010 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). Quote Link to comment https://forums.phpfreaks.com/topic/194975-php-include-question/#findComment-1025050 Share on other sites More sharing options...
jaminb2030 Posted March 12, 2010 Author Share Posted March 12, 2010 lol searched the web forever and the answers so simple! Thanks for the extra info too Quote Link to comment https://forums.phpfreaks.com/topic/194975-php-include-question/#findComment-1025055 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.