Jump to content

Archived

This topic is now archived and is closed to further replies.

Guteman

One config file, please help

Recommended Posts

I am having an issue. I am creating a website with a number of directories. I want to have it so I only have 1 config file in a designated config directory. When im in my admin directory and I want to include my config file, it wont work unless I copy and paste the config.php into the admin directory. I only want 1 config file. What do I need todo to make this work like it should. I cant seem to find any tutorial on this.

Thanks,
Guteman

Share this post


Link to post
Share on other sites
If your folders were like so:
Root
-admin
--admin.php
-config
-images
index.php

And you were in the admin.php, for example you would do:
[code]<?php
include("../config/config.php");
?>[/code]

Hope that helps...
Each time you go up a directory just use ../ as a prefix...
If you had:
Root
-admin
--template
---header.tpl
-config
-images
index.php

And you wanted to include the config file in your admin header.tpl you'd do this:
[code]<?php
include("../../config/config.php");
?>[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.