Thread: includes
View Single Post
  #3 (permalink)  
Old 08-28-2006, 01:31 AM
John's Avatar   
John John is online now
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,582
Last Blog:
Tidy up your HTML
Credits: 0
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default

i didnt look at the links because im too lazy, but ill explain what you're trying to do.

the main thing you need to know is where the files are located in ralation to eachother; say your directory structure looks like this:

Code:
>Directory
     ->includes
              -->lang.php
              -->config.php

     ->admin
              -->folder2
                      ---> file1.php
              -->admin.php
  
    ->index.php
    ->mainfile.php
Lets first assume you are working with mainfile.php and you want to include config.php you would do:
PHP Code:
include('includes/config.php'); 
Now lets assume you are working with admin.php and want to include config.php you would have to use the .. (two dots) for example
PHP Code:
include('../includes/config.php'); 
which basically tells php to "go back one directory and then navigate to the includes directory then include the config.php file.' Lastly lets say you are working with file1.php you would have to use 2 sets of .. (two dots) telling php to 'go back two directorys then navigate to the includes directory and include config.php'
PHP Code:
include('../../includes/config.php'); 
i think thats what you're trying to do
Reply With Quote