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 » Thu Mar 24, 2005 1:50 pm
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
Joe
Forum Regular
Posts: 939 Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow
Post
by Joe » Thu Mar 24, 2005 2:05 pm
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>";
pinehead18
Forum Contributor
Posts: 329 Joined: Thu Jul 31, 2003 9:20 pm
Post
by pinehead18 » Thu Mar 24, 2005 3:44 pm
I don't get the parse error anymore, but it will not display the conents in that var..
Any ideaS?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Mar 24, 2005 3:47 pm
are you sure there's data in it that can print?
Code: Select all
var_dump($config['bgcolor_main']);
pinehead18
Forum Contributor
Posts: 329 Joined: Thu Jul 31, 2003 9:20 pm
Post
by pinehead18 » Thu Mar 24, 2005 4:22 pm
Var dump dumps the right information.. But when i have it in that code above it will not post the right information.
Ambush Commander
DevNet Master
Posts: 3698 Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US
Post
by Ambush Commander » Thu Mar 24, 2005 6:07 pm
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.
pinehead18
Forum Contributor
Posts: 329 Joined: Thu Jul 31, 2003 9:20 pm
Post
by pinehead18 » Thu Mar 24, 2005 7:05 pm
Still does not work inside the <td> but does dump the correct information