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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
andylyon87
Forum Contributor
Posts: 168
Joined: Sat Jan 31, 2004 5:31 am
Location: Dundee

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

Post 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]

redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post 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'.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

under Linux it's 1
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

under windows it's generally 1 too.
andylyon87
Forum Contributor
Posts: 168
Joined: Sat Jan 31, 2004 5:31 am
Location: Dundee

Post by andylyon87 »

thats the prob you see, that isn't working
andylyon87
Forum Contributor
Posts: 168
Joined: Sat Jan 31, 2004 5:31 am
Location: Dundee

Post 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.
User avatar
launchcode
Forum Contributor
Posts: 401
Joined: Tue May 11, 2004 7:32 pm
Location: UK
Contact:

Post by launchcode »

Post your directory structure (and the name of the file this include line is in) ?
andylyon87
Forum Contributor
Posts: 168
Joined: Sat Jan 31, 2004 5:31 am
Location: Dundee

Post 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.
Post Reply