tarun Posted April 22, 2007 Share Posted April 22, 2007 Its more typing that way, sometimes ../ is better, but, say you want to call up a page from 3 different locations on your server, a stats page for example. if you use ../stats.php, wherever you call it up from it will think that you mean ../ relative to that location, if you use $_SERVER['DOCUMENT_ROOT'] it will know exactly where the page you are looking for is located. ../ is mostly guesswork, that is why I prefer the $_SERVER method. Okay I Saw This Quote Somewhere And It Exactly What I Need Answering Who Could I Use $_SERVER To Do The Above AnyHelp Thnx, Tarun Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted April 22, 2007 Share Posted April 22, 2007 Some people like to do require $_SERVER['document_root'] . '/path/to/my/file.php'; this isn't what I do but I'll spare you the explanation and just leave it at that Quote Link to comment Share on other sites More sharing options...
tarun Posted April 23, 2007 Author Share Posted April 23, 2007 Some people like to do require $_SERVER['document_root'] . '/path/to/my/file.php'; this isn't what I do but I'll spare you the explanation and just leave it at that Rather Than "require" I NEED!!! To Use "file" Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted April 23, 2007 Share Posted April 23, 2007 ... then do it? $file = file($_SERVER['document_root'] . '/path/to/my/file.php'); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.