Page 1 of 1

font color/background color with config.php

Posted: Sun Aug 17, 2003 4:55 pm
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

Posted: Sun Aug 17, 2003 5:05 pm
by toms100
can you paste the outputted html
allways add the #
dont see why you need a database connection...

Posted: Sun Aug 17, 2003 5:53 pm
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

Posted: Sun Aug 17, 2003 5:55 pm
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 # :?

Posted: Sun Aug 17, 2003 5:57 pm
by weasel
ok... but the links still are not white :?

Posted: Mon Aug 18, 2003 2:17 am
by toms100
are you sure you have php on ur server?