Re: includes
| From: | Angie Tollerson | Date: | Thu, 09 Aug 2001 13:44:46 +0000 |
| Subject: | Re: includes | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-8731@lists.php.net to get a copy of this message | ||
well...but that is using the full path, which obviously would work...by tacking on the base path on
the front. Maybe I'll just start making a practice to do that.
Thanks!
Angie
>>> "Ignatius Teo" <iteo@scu.edu.au> 08/07/01 06:48PM >>>
What happens when you move stuff up or down a directory level?
I normally do this:
config.php
----------
define('BASE_DIR',getenv('DOCUMENT_ROOT').'/somedir/');
main.php
--------
include('config.php');
include(BASE_DIR.'phpfile.php');
include(BASE_DIR.'someother_dir/phpfile.php');
YMMV,
Ignatius
----- Original Message -----
From: "Angie Tollerson" <Tollerson@alliancetechnologies.net>
To: <will3477@home.com>; <php-windows@lists.php.net>
Sent: Wednesday, August 08, 2001 7:07 AM
Subject: Re: [PHP-WIN] includes
> I noticed that is necessary only on Apache...IIS you don't need it. That
might have been why you didn't know if you are using windows and had been
developing using IIS before. To add a new question to this thread:
> Has anyone else been able to get includes to work from the top of the web?
For some reason..if I want to move around directories (i'm using windows
2000 and 4.0.5) I have to do this:
> include("../../phpfile");
> when I want to do this:
> include("/admin/folder/phpfile");
>
> any ideas?
>
> Angie Tollerson
> Alliance Technologies
> Web Programmer
> (515)245-7628
> tollerson@alliancetechnologies.net
>
> >>> "William E. T." <will3477@home.com> 08/07/01 01:52PM >>>
> THat works. Thanks. I was clueless as to why it wouldn't work. Could
you
> explain why the ./ is necessary? I'm still a newbie, and I'm just curious
so
> that I don't repeat the same mistake in other areas.
> Thanks
> William
>
>
> Angie Tollerson wrote:
>
> > try include("./main.inc");
> >
> > >>> "William E. T." <will3477@home.com> 08/07/01 12:41PM
> > >>> >>>
> > I'm running apache on win98 as a test platform for a site, but whenever
> > I do includes it says it can't read the file. I know the file is there,
> > as apache lists it in the director listing.
> > The exact error I get is
> > Warning: Failed opening 'main.inc' for inclusion (include_path='..')
> > in
> > c:\program files\apache group\apache\htdocs\site\index.php on line 45
> >
> > The syntax I used to call the include is
> > include("main.inc");
> >
> > This worked on the REAL server I'm using, so I was wondering why it
> > won't work locally.
> > Thanks
> > William
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-windows-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>