Ok, what I'm trying to do is :
create a link like this http://www.domain.com/folder1
inside "folder1" I have an index.php with only this code :
<?php include("../file.php"); ?> and that file is calling other files on the root
and I have an error message lie this :
Warning: include(includes/connection.php) [function.include]: failed to open stream: No such file or directory in /Applications/MAMP/htdocs/clint/includes/header.php on line 1
I hope someone understand what I'm trying to do
Thank You
PATH Problem
Moderator: General Moderators
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: PATH Problem
It all depends on where you're calling the file from.
To call the following file: http://www.domain.com/includes/connection.php
from: http://www.domain.com/folder1/index.php
you would write:
To call the following file: http://www.domain.com/includes/connection.php
from: http://www.domain.com/folder1/index.php
you would write:
Code: Select all
include("../includes/connection.php"); // ../ is equivelant to up one level
-
joseluisxxi1
- Forum Newbie
- Posts: 2
- Joined: Mon Apr 21, 2008 6:08 pm
Re: PATH Problem
yes I can use include("../includes/connection.php")
but what ....if I run a file from the root and I can't use ../includes
how I can tell the paths if the file comes from the root or from a subfolder
but what ....if I run a file from the root and I can't use ../includes
how I can tell the paths if the file comes from the root or from a subfolder
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: PATH Problem
Take a look at: http://helicron.net/php/