4

So I was messing around with the twitter api, and I want to include this file in the footer for every page. The footer is loaded via phps require_once function. The problem is I can't use a full url because of url file acsess being turned off for obvious reasons. So I tried to use

require_once $_SERVER['DOCUMENT_ROOT']('/lib/twitter/base.php');

But that failed. What am I doing wrong or how can I do this better?

Phil
  • 157,677
  • 23
  • 242
  • 245
Tyler Radlick
  • 184
  • 1
  • 6
  • 12
  • 1
    That will try to use the value of `$_SERVER['DOCUMENT_ROOT']` as the name of a function, then execute it with `/lib/twitter/base.php` as an argument and then include that result. – Corbin Apr 26 '12 at 01:24

1 Answers1

11

Try this:

require_once($_SERVER['DOCUMENT_ROOT'].'/lib/twitter/base.php');
Cassie Smith
  • 503
  • 3
  • 12