Xero Posted October 18, 2009 Share Posted October 18, 2009 Hello.I have one project here that is separated by folders: .www..test...test.php..main...index.phpI want that the file index.php includes the test.php file. How can I do in a way that I don't need to know the DOCUMENT_ROOT and don't need to use '../'?For example. In html, I just use '/test/test.php' and it works. How can I do this in php?I hope I was clear on my question.Thank you for reading.Help me! Link to comment Share on other sites More sharing options...
chibineku Posted October 18, 2009 Share Posted October 18, 2009 Uh, that should work in php too, I think. The rules for file locations etc. are the same. Link to comment Share on other sites More sharing options...
Xero Posted October 18, 2009 Author Share Posted October 18, 2009 I tried that. But it does not work. It says that it can't find the specified stream. Any other suggestions? Link to comment Share on other sites More sharing options...
justsomeguy Posted October 18, 2009 Share Posted October 18, 2009 On a Linux server the file system root as at /, so if you're telling it to look for /test it's going to assume you're looking for a folder called test in the root of the filesystem.You can either use ../ or use something like $_SERVER['DOCUMENT_ROOT'] to start with. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.