Page 1 of 1

Calling config

Posted: Fri Jun 18, 2004 9:26 am
by pinehead18
I've created a config file. $config['header_table'] = "#FFFFFF"; is one of the examples.

Now, when i include the config.inc.php onto index.php and try to pull that config with the following code it does not work


<table border=0 bgcolor=<?php echo $config['header_table']; ?>>

it does not work.

Any ideas?

Am i including it wrong? Am i not creating the config file right'?

Thank you
Anthony

Posted: Fri Jun 18, 2004 9:27 am
by Joe
Just a question. But are you using include("config.php"); :P

Posted: Fri Jun 18, 2004 9:36 am
by pinehead18
my config file is config.inc.php and my functions file is functions.inc.php

my functions file contains require('config.inc.php');

then my header file contains

require('functions.inc.php');

then my index.php file contains require('html.inc.php');

Thank you

Posted: Fri Jun 18, 2004 9:46 am
by Joe
I personally think you must be declaring something in config.inc.php wrong as your code seems fine to me. As a test try:

$header_table = "#FFFFFF";

instead of:

$config['header_table'];

just to see if it works. :P

Posted: Fri Jun 18, 2004 11:11 am
by pinehead18
Thanks for your help, it seems it was my fault. For some reason i had a space between $config and [header_table]

If it wasn't for you suggesting to try it without $config iw ould have not figured it out htis morning lol

Posted: Fri Jun 18, 2004 11:28 am
by Joe
NP, Happy coding ;)