Page 1 of 1

need help with parse stuff

Posted: Thu Mar 24, 2005 1:50 pm
by pinehead18
Ok, i'm trying to pull the table color from a config setting i'm making but this sytax i have made is wrong. Thank you for any help you can provide.

Code: Select all

echo "<td style=\"border-top: 2px solid #3D4A67; border-left: 2px solid #3D4A67; background-color: "; $config['bgcolor_main']; echo "\" height=\"7%\">hi";
Parse error: parse error, unexpected ';' in /home/pinehead/www/config.inc.php on line 29


That is my error, i'm sure this is not the best way to do this so if you can suggest a better way that would be great too.

Thank you
Anthony

Posted: Thu Mar 24, 2005 2:05 pm
by Joe
Try:

Code: Select all

echo "<td style=\"border-top: 2px solid #3D4A67; border-left: 2px solid #3D4A67; background-color: ". $config['bgcolor_main']. ";\" height=\"7%\">hi</td>";

Posted: Thu Mar 24, 2005 3:44 pm
by pinehead18
I don't get the parse error anymore, but it will not display the conents in that var..

Any ideaS?

Posted: Thu Mar 24, 2005 3:47 pm
by feyd
are you sure there's data in it that can print?

Code: Select all

var_dump($config['bgcolor_main']);

Posted: Thu Mar 24, 2005 4:22 pm
by pinehead18
Var dump dumps the right information.. But when i have it in that code above it will not post the right information.

Posted: Thu Mar 24, 2005 6:07 pm
by Ambush Commander

Code: Select all

echo "<td
style=\"border-top: 2px solid #3D4A67; border-left: 2px solid #3D4A67; background-color:{$config['bgcolor_main']};\"
height=\"7%\">
hi
</td>";
var_dump($config['bgcolor_main']);
Give us the exact output.

Posted: Thu Mar 24, 2005 7:05 pm
by pinehead18
Still does not work inside the <td> but does dump the correct information

Posted: Thu Mar 24, 2005 7:07 pm
by John Cartwright
repost EXACKLY what you are doing.