Silly task...Changing Text colour

G

Guest

Guest
Hi There

This is driving me around the twist, it is a simple task yet it will not except it.
<?




if ($Category != "") {

$query = "SELECT * FROM Downloads ";
if ($Category != 0) {
$query .= "WHERE Category=" . $Category;
}

$rst = mysql_query($query, $con);
if (!$rst) {
echo mysql_error();
mysql_close($con);
exit;
}

if (mysql_num_rows($rst) == 0 ) {
echo "<TD colspan=\"4\"font size=\"2\" text=\"#FFFFFF\"><FONT FACE=ARIAL SIZE=2>No items in category</FONT></TD></TEXT>";
} else {

$MAXPAGES = mysql_num_rows($rst);
for($i=0;$i<($CurrentPage-1) * $DOWNLOADS_PER_PAGE; $i++) {

if (!$row = mysql_fetch_row($rst)) {
exit;
}

}

$i=0;
while (($row = mysql_fetch_row($rst)) && $i<10) {
$i++;
echo "<TR>\n";
echo "\t\t<TD><FONT FACE=ARIAL SIZE=2><A HREF=\"sendfile.php3?Product=" . $row[4] . "&DownloadID=" . $row[0];
if ($row[7] != "")
{
echo "&redirect=" . $row[7];
}
echo "\">" . $row[1] . "</A></FONT></TD>\n";
echo "\t\t<TD><FONT FACE=ARIAL SIZE=2>" . $row[2] . "</FONT></TD>\n";
echo "\t\t<TD><FONT FACE=ARIAL SIZE=2>" . $row[3] . "</FONT></TD>\n";
echo "\t\t<TD><FONT FACE=ARIAL SIZE=2>" . $row[5] . "</FONT></TD>\n";
echo "\t</TR>\n";
}

}

}

mysql_close($con);

?>
</TABLE>
<HR>
<font color="#FFFFFF">
<?

if ($CurrentPage == 1) {
if (($CurrentPage * $DOWNLOADS_PER_PAGE) > $MAXPAGES) {
echo "<FONT FACE=ARIAL SIZE=2><b>| Previous Page | Next Page |</b></FONT>";
} else {
echo "<FONT FACE=ARIAL SIZE=2><b>| Previous Page | </b><A HREF=\"downloads.php3?Category=$Category&CurrentPage=2\"><b>Next Page</b></A> |</FONT>";
}
} elseif ($CurrentPage > 1) {

if (($CurrentPage * $DOWNLOADS_PER_PAGE) > $MAXPAGES) {
echo "<FONT FACE=ARIAL SIZE=2>| <A HREF=\"downloads.php3?Category=$Category&CurrentPage=" .($CurrentPage -1) . "\">Previous Page</A><b> | Next Page |</b></FONT>";
} else {
echo "<FONT FACE=ARIAL SIZE=2>| <A HREF=\"downloads.php3?Category=$Category&CurrentPage=" .($CurrentPage -1) . "\">Previous Page</A> | <A HREF=\"downloads.php3?Category=$Category&CurrentPage=" . ($CurrentPage+1) . "\">Next Page</A> |</FONT>";
}
}
?>

all I want to do is change the echo text (No items in category) to the colour White as I have a dark background, I have tried everything.
I have had no problem changing anything else in the coding.

look forward to any reply

Richard
 
If you are trying to change the color of a link, dont use the font tag unless you are attempting to provide maxium compatibility for older browsers. (NOTE: This is just my opinion)
Use something like the following:
Code:
echo "<a href=\"whatever.php\" style=\"color: #ffffff;\">Link Text</a>";

This is using CSS to change the color of the font. You can also check out http://www.w3schools.com/css/css_reference.asp for more specific information.

The way that you are doing it, you would have to use an attribute in the <font> tag to change the text color. Not 100% sure on how to do that, but none-the-less, I would recommend the CSS

Will
 
findit said:
Hi There

This is driving me around the twist, it is a simple task yet it will not except it.
<?




if ($Category != "") {

$query = "SELECT * FROM Downloads ";
if ($Category != 0) {
$query .= "WHERE Category=" . $Category;
}

$rst = mysql_query($query, $con);
if (!$rst) {
echo mysql_error();
mysql_close($con);
exit;
}

if (mysql_num_rows($rst) == 0 ) {
echo "<TD colspan="4"font size="2" text="#FFFFFF"><FONT FACE=ARIAL SIZE=2>No items in category</FONT></TD></TEXT>";
} else {

$MAXPAGES = mysql_num_rows($rst);
for($i=0;$i<($CurrentPage-1) * $DOWNLOADS_PER_PAGE; $i++) {

if (!$row = mysql_fetch_row($rst)) {
exit;
}

}

$i=0;
while (($row = mysql_fetch_row($rst)) && $i<10) {
$i++;
echo "<TR>\n";
echo "\t\t<TD><FONT FACE=ARIAL SIZE=2><A HREF="sendfile.php3?Product=" . $row[4] . "&DownloadID=" . $row[0];
if ($row[7] != "")
{
echo "&redirect=" . $row[7];
}
echo "">" . $row[1] . "</A></FONT></TD>\n";
echo "\t\t<TD><FONT FACE=ARIAL SIZE=2>" . $row[2] . "</FONT></TD>\n";
echo "\t\t<TD><FONT FACE=ARIAL SIZE=2>" . $row[3] . "</FONT></TD>\n";
echo "\t\t<TD><FONT FACE=ARIAL SIZE=2>" . $row[5] . "</FONT></TD>\n";
echo "\t</TR>\n";
}

}

}

mysql_close($con);

?>
</TABLE>
<HR>
<font color="#FFFFFF">
<?

if ($CurrentPage == 1) {
if (($CurrentPage * $DOWNLOADS_PER_PAGE) > $MAXPAGES) {
echo "<FONT FACE=ARIAL SIZE=2><b>| Previous Page | Next Page |</b></FONT>";
} else {
echo "<FONT FACE=ARIAL SIZE=2><b>| Previous Page | </b><A HREF="downloads.php3?Category=$Category&CurrentPage=2"><b>Next Page</b></A> |</FONT>";
}
} elseif ($CurrentPage > 1) {

if (($CurrentPage * $DOWNLOADS_PER_PAGE) > $MAXPAGES) {
echo "<FONT FACE=ARIAL SIZE=2>| <A HREF="downloads.php3?Category=$Category&CurrentPage=" .($CurrentPage -1) . "">Previous Page</A><b> | Next Page |</b></FONT>";
} else {
echo "<FONT FACE=ARIAL SIZE=2>| <A HREF="downloads.php3?Category=$Category&CurrentPage=" .($CurrentPage -1) . "">Previous Page</A> | <A HREF="downloads.php3?Category=$Category&CurrentPage=" . ($CurrentPage+1) . "">Next Page</A> |</FONT>";
}
}
?>

all I want to do is change the echo text (No items in category) to the colour White as I have a dark background, I have tried everything.
I have had no problem changing anything else in the coding.

look forward to any reply

Richard

Hi there!
Interesting how it's work?
Code:
if ($Category != "") { 

$query = "SELECT * FROM Downloads "; 
if ($Category != 0) { 
$query .= "WHERE Category=" . $Category; 
}

if your variiable $Category != "" and $Category != 0 not as same?
 
2WiZARD

Man, it is not same!

If var is empty them it will be true

Code:
if ($emptyvar == null)
if ($emptyvar == "")
if (!$emptyvar)

2elitecodex
Yea man CSS is COOL!

2findit
USE IT!

or

your code

Code:
echo "<TD colspan=\"4\"font size=\"2\" text=\"#FFFFFF\"><FONT FACE=ARIAL SIZE=2>No items in category</FONT></TD></TEXT>";

my code

Code:
echo ("<TD colspan=4><FONT FACE=ARIAL SIZE=2 color=#000000>No items in category</FONT></TD></TEXT>");

regards...
 
Back
Top