Re: Include fails when "./" is in front of file name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---- Daniel Brown <parasane@xxxxxxxxx> wrote: 
> On Sun, Apr 6, 2008 at 5:17 PM, Noah Spitzer-Williams <noahsw@xxxxxxxxx> wrote:
> > This works:
> >    include("file.inc.php");
> >
> >  This doesn't:
> >    include("./file.inc.php");
> 
>     That's pretty vague, Noah.  Is it unable to locate the file?
> What's the error message you're receiving?
> 
>     Also, what happens if you create two simple files in the same
> directory like so:
> <?php
> // file1.php
> echo "Okay.\n";
> ?>
> 
> <?php
> // file2.php
> include(dirname(__FILE__).'/file1.php');
> ?>

Noah,

Looks like you need to be deciding on whether or not you are on windoze or *Nix.

If on Windoze, your include path is \
If on *Nix, your include path is /

Notice the direction of the slashes and code appropriately in all locations.

Wolf


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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux