Jump to content

file path question


phporcaffeine

Recommended Posts

***SYS SPECS***
Apache 2.2.3
PHP 5.2
Win XP Pro
Has Access to PHP.INI
Has Access to httpd.conf
*******************

here is a sample folder tree that I have

/root
|> folder_1
       |> file_1.php
|> file_2.php

I want to 'require()' file_2.php FROM file_1.php.  Why can't I use [code]require('../file_2.php');[/code] in file_1.php?

If it can be done that way, could someone show me how?  I have been playing with include_path in the .INI all day and I have yet to figure it out.

If you have a better solution, I'm up for that as well. 

My basic objective is to be able recursivly 'require' / 'include' files without having to enter the full file/url path.

TIA
Link to comment
https://forums.phpfreaks.com/topic/32733-file-path-question/
Share on other sites

here is the error:

Warning: require(../ktrack_inclusion.php) [function.require]: failed to open stream: No such file or directory in F:\Apache2\htdocs\modules\ktrack\library\inc\headers\header.global.php on line 5

The file 'ktrack_inclusion.php' exists in: F:\Apache2\htdocs\modules\ktrack\library\inc
Link to comment
https://forums.phpfreaks.com/topic/32733-file-path-question/#findComment-152366
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.