Jump to content


Photo

text is the same color as background


  • Please log in to reply
2 replies to this topic

#1 jjf

jjf
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 07 August 2006 - 05:37 PM

This one's puzzling me quite a bit.  I guess I'm missing something obvious, but I sure can't see what it is.

I'm modifying an open-source PHP timecard program for use on a Windows Business Server 2003.  In Linux (where it was written and where I did most of the major modifications), everything displays fine.  But when ported to Windows, the text color = the background color in both Firefox and IE. 

So PHP code like this:

<table border="0" cellpadding="2" cellspacing="2" bgcolor="<?= $default->light_bg_color ?>" text="<?= $default->dark_text_color ?>" align="center" valign="top">

(where light_bg_color = "#ffffff" and dark_text_color = "#000000")

creates source code like this:

<table border="0" cellpadding="2" cellspacing="2" bgcolor="#ffffff" text="#000000" align="center" valign="top">

But the output text is white! 

I found by changing the light_bg_color and dark_text_color values that no matter what I tell the text color to be, it displays in whatever color is set for bgcolor.  For example, if I set my background to purple and my text to red, my background and text are both purple.

I can't imagine why Windows would behave one way on this and Linux another.  Is there a setting in my PHP.INI file that is incorrect?

Thanks for any help.

#2 jjf

jjf
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 07 August 2006 - 05:48 PM

In case it will help, I will add some more complete source code:

<html>
<head>
<title>OATS Timecard</title>
<link href="css.php" rel="stylesheet" text="text/css">
</head>
<body bgcolor="#ffffff" text="#000000" marginheight="0" marginwidth="0"> 

<table border="0" cellpadding="6" cellspacing="0" width="100%" valign="top" bgcolor="#085d8b">
  <tr>
    <td class="topbarcell" valign="top" align="center" nowrap="nowrap">
      <font color="#ffffff">
      <a href="timecard.php?">Timecard</a> | <a href="jobs.php?actionID=show_jobs&">My Jobs</a> | <a
 href="personal_info.php?">Personal Info</a> | <a href="faq.php?">FAQ</a> | <a 
href="user.php?actionID=4&">Change Password</a> | <a href="admin.php?">Admin</a> | <a 
href="problem_report.php?">Report a Problem</a> | <a href="login.php?actionID=34&">Log Out</a>      </font>

    </td>
  </tr>
</table>
<table border=0 cellpadding=2 cellspacing=2 bgcolor=#ffffff text=#000000 align=center valign=top>
<form method=post name="timecard" action="timecard.php?" onSubmit="return checkSubmit();">
<tr>
  <td align="center" colspan="2">
    <br/>
    <b>Welcome, <a class='dark' href=personal_info.php?>admin</a>. &nbsp;Please Choose An 
Action.</b><br>Aug 07 (Mon.) 2006, 1:43pm    <br />

      </td>
</tr>
...
...

I expect the background to be white and the text black.  Instead both bg and text are white.

#3 jjf

jjf
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 07 August 2006 - 06:15 PM

D'OH!  :P

I figured it out.  I had an extra line in my css.php file forcing the text color to take the background color:

  color: <?= $default->light_bg_color ?>;

I have no idea what madness overtook me that I would add such a line. 

BTW, I much prefer developing in Linux.  grep and diff (comparing my version to a backup version) could have solved this problem long ago.  Maybe such tools exist in Windows, but I don't know them.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users