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
pinehead18
Forum Contributor
Posts: 329 Joined: Thu Jul 31, 2003 9:20 pm
Post
by pinehead18 » Fri Jun 18, 2004 9:26 am
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
Joe
Forum Regular
Posts: 939 Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow
Post
by Joe » Fri Jun 18, 2004 9:27 am
Just a question. But are you using include("config.php");
pinehead18
Forum Contributor
Posts: 329 Joined: Thu Jul 31, 2003 9:20 pm
Post
by pinehead18 » Fri Jun 18, 2004 9:36 am
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
Joe
Forum Regular
Posts: 939 Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow
Post
by Joe » Fri Jun 18, 2004 9:46 am
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.
pinehead18
Forum Contributor
Posts: 329 Joined: Thu Jul 31, 2003 9:20 pm
Post
by pinehead18 » Fri Jun 18, 2004 11:11 am
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
Joe
Forum Regular
Posts: 939 Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow
Post
by Joe » Fri Jun 18, 2004 11:28 am
NP, Happy coding