salman_ahad@yahoo.com Posted November 22, 2009 Share Posted November 22, 2009 Myfile "file1.php" is in [content] folder I need to include a file "connection.php" which is in [include] folder These two folders [content] and [include] are at same level. How do I require("connection.php") in file1.php Quote Link to comment Share on other sites More sharing options...
emopoops Posted November 22, 2009 Share Posted November 22, 2009 require($_SERVER["DOCUMENT_ROOT"] . "/rawr/vgvhr.php"); Quote Link to comment Share on other sites More sharing options...
Alex Posted November 22, 2009 Share Posted November 22, 2009 require '../include/connection.php'; - ../ is used to go up a level in a directory structure. Quote Link to comment Share on other sites More sharing options...
salman_ahad@yahoo.com Posted November 22, 2009 Author Share Posted November 22, 2009 I am getting a warning and fatal error stating the file is not present?? Quote Link to comment Share on other sites More sharing options...
Alex Posted November 22, 2009 Share Posted November 22, 2009 Your directory structure is like this, correct? include connection.php content file1.php If so to access connection.php the correct path would be ../include/connection.php Quote Link to comment Share on other sites More sharing options...
salman_ahad@yahoo.com Posted November 22, 2009 Author Share Posted November 22, 2009 Thats right Alex... but I fixed it by altering the files. But thanks u showed me something new... 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.