require-once

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
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

require-once

Post by Vegan »

Code: Select all

include $_SERVER["DOCUMENT_ROOT"] . "/fb/facebook.php";
require_once("facebook.php");
how can I deal with the document_root relative include vs the require_once
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: require-once

Post by requinix »

Both include and require_once just want file paths. They don't care how you construct it.

Code: Select all

require_once $_SERVER["DOCUMENT_ROOT"] . "/fb/facebook.php";
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: require-once

Post by Vegan »

thanks
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Post Reply