font color/background color with config.php

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

Post Reply
weasel
Forum Commoner
Posts: 27
Joined: Sat Aug 16, 2003 3:27 pm

font color/background color with config.php

Post by weasel »

ok... this is what im trying to do... use config.php to change the font/background color...this is what i have for config.php

<?php
mysql_connect(localhost,triggerh_maps,maps);
mysql_select_db(triggerh_THCSTATS);
$bg = "ffffff"; // Background color ONLY numbers, do NOT put the #
$fc = "000000"; //Font color, ONLY numbers! do NOT put the #

?>

and in layout1.php(just for the font and bg color)

<body bgcolor="<?php echo $bg; ?>">
<font color="<?php echo $fc?>">


its... not working:S
thx for any help
toms100
Forum Contributor
Posts: 119
Joined: Wed Feb 26, 2003 10:29 am
Location: Bristol,UK

Post by toms100 »

can you paste the outputted html
allways add the #
dont see why you need a database connection...
weasel
Forum Commoner
Posts: 27
Joined: Sat Aug 16, 2003 3:27 pm

Post by weasel »

well i need that db stuff for the other content on the layout1.php...
here is the rest of layout1.php
<body bgcolor="#<?php echo $bg; ?>" link="#<?php echo $fc ?>" vlink="#<?php echo $fc ?>">


<?php
include('config.php');
$id = $_GET['id']; // Put this somewhere above the declaration of $result

$result = mysql_query("select * from maps where id='$id'");

if ($result)
{
$row = mysql_fetch_array($result);
$name = $row["name"];
$mname = $row["mname"];
$dis = $row["discription"];
$dl = $row["dllink"];
}
else { }
?>

<font color="#<?php echo $fc ?>">
<center>
<table>
<tr>
<td>
<font color="#<?php echo $fc ?>">Map name:
</td>
<td>
<font color="#<?php echo $fc ?>"><?php print "$mname" ?>
</td>
</tr>
<tr>
<td>
<font color="#<?php echo $fc ?>">Map creator:
</td>
<td>
<font color="#<?php echo $fc ?>"><?php print "$name" ?>
</td>
</tr>
<tr>
<td>
<font color="#<?php echo $fc ?>">Download:
</td>
<td>
<font color="#<?php echo $fc ?>"><a href="<?php print $row['dllink']; ?>"><?php print $row['mname']; ?></a>

</td>
</tr>
</table>
</center>

still cant see the php printed stuff....
http://www.triggerhappycheaters.com/maps/layout1.php
weasel
Forum Commoner
Posts: 27
Joined: Sat Aug 16, 2003 3:27 pm

Post by weasel »

ohh! i see now!
you have to go to http://www.triggerhappycheaters.com/map ... 1.php?id=2
all i was forgeting was the # :?
weasel
Forum Commoner
Posts: 27
Joined: Sat Aug 16, 2003 3:27 pm

Post by weasel »

ok... but the links still are not white :?
toms100
Forum Contributor
Posts: 119
Joined: Wed Feb 26, 2003 10:29 am
Location: Bristol,UK

Post by toms100 »

are you sure you have php on ur server?
Post Reply