Correohs Posted September 28, 2009 Share Posted September 28, 2009 Help needed. I have 3 domains pointing same directory in my webserver (ISP) mysite.com mysite.net mysite.info I wanted to use (1) one menu file for all of them, that I load it to the include subfolder. mywebsite structure /index.php ( I use include $_SERVER['DOCUMENT_ROOT']."/include/menu.html"; ) /about.php ( I use include $_SERVER['DOCUMENT_ROOT']."/include/menu.html"; ) /contactus.php ( I use include $_SERVER['DOCUMENT_ROOT']."/include/menu.html"; ) /(more files) ( I use include $_SERVER['DOCUMENT_ROOT']."/include/menu.html"; ) /link/ /link/index.php ( I use include $_SERVER['DOCUMENT_ROOT']."/include/menu.html"; ) /link/(more php files) ( I use include $_SERVER['DOCUMENT_ROOT']."/include/menu.html"; ) /include /include/menu.html Menu File Structure <li><a href="aboutus.php">ABOUT</a> <ul><li><a href="aboutus.php">ABOUT US</a></li> <li><a href="contactus.php">CONTACT US</a></li> <li><a href="testimonial.html">GUEST BOOK</a></li> </ul> </li> from my php application I use include $_SERVER['DOCUMENT_ROOT']."/include/menu.html"; Pages on root directory are working well. /aboutus.php /contactus.php /testimonial.html when I'm on /link directory (subfolder )I got problems the menu will point to. /link/aboutus.php /link/contactus.php /link/testimonial.html Getting page no found. if I'm in a subfolder, how can I do to call the include file, and preserver the root path automatically. ---- let me try to make simpler ---- 3 mysites domain mysite.com mysite.net mysite.info .com .net .info / /index.php /about.php /contactus.php /testimonial.html /(more files) /link/ /link/index.php /link/(more php files) /include/menu.html How can I call /include/menu.html from any directory level and maintain same behavior? ------ Thanks! CorreoHS Quote Link to comment 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.