Include from ROOT

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
AliasBDI
Forum Contributor
Posts: 286
Joined: Fri Nov 15, 2002 10:35 am
Location: Spring, TX, USA

Include from ROOT

Post by AliasBDI »

To my knowledge, includes using "/" as the root do not work (ex: "/page.php"). Is there an alternative besides using the server path?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

/page.php

should work.. as long as page.php is in the root of the server, if page.php is in the same directory as your script include

page.php

or

/full/path/to/script/page.php



try

Code: Select all

print_r($_SERVER);
to get information about the directories your script is operating under, you can use values from the SERVER superglobal to generate absolute URIs to files on your server
Post Reply