Page 1 of 1

[quick one] Can't remember how to back folder an include

Posted: Mon Jun 14, 2004 7:18 am
by andylyon87
to include a file that is one folder back I would use

1. їcode]include("../review.php");ї/code]

or

2. їcode]include("\..\review.php");ї/code]

3. їcode]include("..\review.php");ї/code]

4. їcode]include("/../review.php");ї/code]


Posted: Mon Jun 14, 2004 7:41 am
by redmonkey
In the time it has taken you to login here and type that message you could have tried each one for yourself.

Why don't you 'suck it and see'.

Posted: Mon Jun 14, 2004 7:45 am
by patrikG
under Linux it's 1

Posted: Mon Jun 14, 2004 11:21 am
by feyd
under windows it's generally 1 too.

Posted: Mon Jun 14, 2004 1:49 pm
by andylyon87
thats the prob you see, that isn't working

Posted: Mon Jun 14, 2004 1:58 pm
by andylyon87

Code: Select all

Warning: Failed opening 'kite_index2.php' for inclusion (include_path='.;C:\Program Files\EasyPHP\php\pear'') in c:\program files\easyphp\www\kite_site\php\form_data\kite\mac\mac_index.php on line 8
when I use no.1 above it just shows this

I use

Code: Select all

include('../kite_index2.php');
Which shows the above error.

I just thought this would be easier for me in the long run.

Posted: Mon Jun 14, 2004 1:59 pm
by launchcode
Post your directory structure (and the name of the file this include line is in) ?

Posted: Mon Jun 14, 2004 2:39 pm
by andylyon87
thanks mate but have after a few too many hours pondering finally sorted it, I had to includ the full root (not normally like this but its the way my nav works.