View Full Version : Need abit help with 'Includes' or some alternatives.
03-15-2008, 05:38 PM
If this has been asked before, please delete or move it.
Let's say I made dir001 (within doc root) and place a file 001.php. Now inside dir001, i make a new dir, dir002 with a file 002.php inside it. Now inside file 002.php, is it possible to 'include' file 001.php which is outside its dir? If 'include' doesn't work, has anyone got any suggestions which i can play use or play around?
03-15-2008, 06:17 PM
Should work. But I'm not 100% sure. If not you can use full directories such as:
03-15-2008, 07:03 PM
If not you can use full directories such as:
Using the URL will only work if the server has allow_url_fopen is on. You should use the full file path if the relative one doesn't work. ie. /home/username/public_html/dir001/001.php This path will vary depending on the server, but you can find it in the phpinfo().
03-15-2008, 08:09 PM
Or most of the time this works as well...
03-19-2008, 04:58 PM
Thanks, it works.
03-19-2008, 07:12 PM
Should work. But I'm not 100% sure.
This technique will work, and is the recommended way. Although if dir002 is contained within dir001, the path should be: ../001.php
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.