Re: [PHP] include like function

2003-07-08 Thread Ian Mantripp
on Tue, Jul 8, 2003, David Otton wrote:

>>> Hello, i need a function that gets a internal file say news.php, and
>>follows
>>> the urls from its copied location,
>>>
>>> say if i am in
>>> /pages/
>>> and i need a file from
>>> /pages/php/wow
>>>
>>> i put
>>> include('php/wow/news.php')
>>> But the news.php file needs a file in the /php/wow directory called
>>> news.inc.php
>>>
>>> how can the php copy every thing accross so a error is not shown
>>> so the
>>> script could read
>>> include('php/wow/news.php', point_links_to('php/wow/')
>
>Wow. That was.. slightly confusing. I /think/ that the include_path
>directive in php.ini may help you.

You can set the include_path to have multiple directories by separating
each path with a colon.

If you are using Apache, you could also use .htaccess files to override
the default config or you could add a directive in the htppd.conf file,
such as :


  php_value include_path "/usr/local/lib/php/:/pages/php/wow/"
 

Ian


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] include like function

2003-07-08 Thread David Otton
On Tue, 8 Jul 2003 09:35:10 +0100, you wrote:

>> Hello, i need a function that gets a internal file say news.php, and
>follows
>> the urls from its copied location,
>>
>> say if i am in
>> /pages/
>> and i need a file from
>> /pages/php/wow
>>
>> i put
>> include('php/wow/news.php')
>> But the news.php file needs a file in the /php/wow directory called
>> news.inc.php
>>
>> how can the php copy every thing accross so a error is not shown
>> so the
>> script could read
>> include('php/wow/news.php', point_links_to('php/wow/')

Wow. That was.. slightly confusing. I /think/ that the include_path
directive in php.ini may help you.

Also check out set_include_path() and it's brethren.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php