Computing.Net > Forums > Web Development > PHP require() - change working dir?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

PHP require() - change working dir?

Reply to Message Icon

Name: RadleyGH
Date: February 20, 2008 at 01:30:08 Pacific
OS: Windows XP Pro
CPU/Ram: Athlon X2 5200+, 2gb DDR2
Product: Custom built
Comment:

I have several require() functions that also have require() functions in them that build the theme of my website. The theme is done, but I tried making a subdirectory and when I use the same page the require() is obviously in a different location.

I tried using require("../inc/includedfile.php"); which does work for the file, but the files within ignore the required files directory and use the current subdirectory.

Can you change the "working directory" of the require() function?



Sponsored Link
Ads by Google

Response Number 1
Name: Laler
Date: February 21, 2008 at 09:33:49 Pacific
Reply:

yep

chdir()

---

And if you went confused because of relative paths, you can use the absolute ones.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: PHP require() - change working dir?

PHP query....with menu www.computing.net/answers/webdevel/php-querywith-menu/1180.html

Noob designer! Need help! www.computing.net/answers/webdevel/noob-designer-need-help/2398.html

PHP sessions not working www.computing.net/answers/webdevel/php-sessions-not-working/571.html