|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
---- Daniel Brown <parasane@gmail.com> wrote: > On Sun, Apr 6, 2008 at 5:17 PM, Noah Spitzer-Williams <noahsw@gmail.com> 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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Mon, Apr 7, 2008 at 11:52 AM, Wolf <lonewolf@nc.rr.com> wrote:
> 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 > > I'm working with a Windows server and able to use ./ in all my includes. Example - require_once( "./library/urs/URS.Framework.php" ); His should work fine also. -- -Dan Joseph "Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, and will be warm for the rest of his life." |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Mon, Apr 7, 2008 at 11:52 AM, Wolf <lonewolf@nc.rr.com> wrote:
> > 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. Actually, PHP is "smart" enough to allow both on Windows. Otherwise, everyone would need to update their code for each different system, which destroys PHP's cross-platform nature. -- </Daniel P. Brown> Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! |
|
![]() |
| Outils de la discussion | |
|
|