Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1577 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

Step Down A Level

Thread title: Step Down A Level
Closed Thread    
    Thread tools Search this thread Display Modes  
02-14-2007, 05:20 PM
#1
Tom is offline Tom
Tom's Avatar
Status: I Code Things
Join date: Aug 2005
Location: UK
Expertise:
Software:
 
Posts: 1,998
iTrader: 14 / 100%
 

Tom is on a distinguished road

Send a message via MSN to Tom

  Old  Step Down A Level

Is it possible in php to step down a level i.e. from a folder. so:

Stepping Up

include(/inc/connect.php);

is there away to go from lets say the inc folder back down to lower folder or to another folder form that one.

02-14-2007, 05:22 PM
#2
localhost is offline localhost
localhost's Avatar
Status: Dediport Hosting
Join date: Jul 2006
Location: Berkshire
Expertise: programming, business
Software: Dreamweaver
 
Posts: 1,316
iTrader: 17 / 100%
 

localhost is on a distinguished road

  Old

I think it would be somethnig like:
PHP Code:
include('../connect.php'); 
Try it, it might be .../ or ..\ ?

02-14-2007, 05:37 PM
#3
Jeff Andersen is offline Jeff Andersen
Status: Superstar
Join date: Apr 2005
Location:
Expertise:
Software:
 
Posts: 4,449
iTrader: 10 / 100%
 

Jeff Andersen is on a distinguished road

  Old

Originally Posted by webmonkey View Post
I think it would be somethnig like:
PHP Code:
include('../connect.php'); 
Try it, it might be .../ or ..\ ?

It's ../ whenever I've done it.

02-14-2007, 05:42 PM
#4
derek lapp is offline derek lapp
Status: design rockstar
Join date: Jan 2005
Location: guelph, ontario
Expertise:
Software:
 
Posts: 2,246
iTrader: 0 / 0%
 

derek lapp is on a distinguished road

  Old

it's ../ for each level.

a file in root/inc/content who wants to access a folder in root would be include(../../file.ext);

02-14-2007, 05:43 PM
#5
Tom is offline Tom
Tom's Avatar
Status: I Code Things
Join date: Aug 2005
Location: UK
Expertise:
Software:
 
Posts: 1,998
iTrader: 14 / 100%
 

Tom is on a distinguished road

Send a message via MSN to Tom

  Old

Alright thanks everybody.

02-14-2007, 08:17 PM
#6
RaZoR^ is offline RaZoR^
RaZoR^'s Avatar
Status: Member
Join date: Feb 2006
Location:
Expertise:
Software:
 
Posts: 191
iTrader: 1 / 100%
 

RaZoR^ is on a distinguished road

  Old

../ goes up 1 directory.
../ goes up 2 directories
-- etc

Also, if you ever need to execute a file on a Linux server (you may wish to do this in PHP some time), you will need to do ./filename. That doesn't go up a directory, but it's the classic Unix-style of doing things

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed