Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force php to look at Document Root

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?

like image 818
Tyler Radlick Avatar asked Dec 17 '22 01:12

Tyler Radlick


1 Answers

Try this:

require_once($_SERVER['DOCUMENT_ROOT'].'/lib/twitter/base.php');
like image 58
Cassie Smith Avatar answered Jan 02 '23 15:01

Cassie Smith