Page 1 of 1

Config File

Posted: Wed Jun 16, 2004 1:11 pm
by pinehead18
I'm wanting to create a config file for my site, and for like my mysql user pass and db's. However, i'm kinda lost attempting to do it.

I thought it was $config['var'] = "Table color or whatever";

Then i includ ethe config file corect? Well my question is, when i am on my individual pages.. How do i call that var.. IE>

<table border="0" backgroundcolor="$config['var']" > ???

Thank you
Anthony

Posted: Wed Jun 16, 2004 1:18 pm
by feyd
<table border="0" backgroundcolor="$config['var']" >
well.. if that's in an echo, i.e.

Code: Select all

<?php
echo "<table border="0" backgroundcolor="{$config['var']}" >"; // or
echo '<table border="0" backgroundcolor="'.$config['var'].'" >'; // there are plenty of other ways..
?>
if it's an include:

Code: Select all

<?php ?>
<table border="0" backgroundcolor="<?php echo $config['var'] ?>" >
is the most compliant of these forms...