Includes are driving me nuts!!!
View Single Post
04-09-2008, 02:49 AM
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
I wish I could remember who it was who suggest this, so I could give them credit, but have you tried using $_SERVER['DOCUMENT_ROOT']? I've started to employ this between my test machine and my remote server and it works quite well. Say if you're local is a windows box, and the document root is C:\my documents\htdocs, and your remote is linux, and it's /www/public_html, using document root, you never have to worry about relative paths, you just
include($_SERVER['DOCUMENT_ROOT'] . "/path/to/include.php");
It's just like using
include("C:\my documents\htdocs\path\to\include.php"); or
except that since you're calling the _SERVER array it will automagically fill in the root based on whatever machine you may transfer the script to.
View Public Profile
Send a private message to delayedinsanity
Visit delayedinsanity's homepage!
Find More Posts by delayedinsanity