note 93767 added to function.include
| From: | correohs at hotmail dot com | Date: | Sun, 27 Sep 2009 15:44:10 +0000 |
| Subject: | note 93767 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-161109@lists.php.net to get a copy of this message | ||
Help needed.
I have 3 domains pointing directory in my webserver (ISP)
mysite.com
mysite.net
mysite.info
I wanted to use one menu for all of them
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>
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.
---
.com .net .info
/
/index.php
/about.php
/contactus.php
/testimonial.html
/(more files)
/link/
/link/index.php
/link/(more php files)
/include/menu.html
---
Thanks!
CorreoHS
----
Server IP: 208.69.120.35
Probable Submitter: 96.255.95.10
----
Manual Page -- http://www.php.net/manual/en/function.include.php
Edit -- https://master.php.net/note/edit/93767
Del: integrated -- https://master.php.net/note/delete/93767/integrated
Del: useless -- https://master.php.net/note/delete/93767/useless
Del: bad code -- https://master.php.net/note/delete/93767/bad+code
Del: spam -- https://master.php.net/note/delete/93767/spam
Del: non-english -- https://master.php.net/note/delete/93767/non-english
Del: in docs -- https://master.php.net/note/delete/93767/in+docs
Del: other reasons-- https://master.php.net/note/delete/93767
Reject -- https://master.php.net/note/reject/93767
Search -- https://master.php.net/manage/user-notes.php