This topic is locked

Changing font color

10/8/2007 3:10:10 PM
PHPRunner General questions
paperhog author

I hve tried several different time to get the font color to change base on the feild being yes or no. It works but when you click on view record you get
<font color=red>No</font>
I have tried

[codebox]if($value=="Yes")

$value="<font color=black>Yes</font>";

else if($value=="No")

$value="<font color=red>No</font>";[/codebox]

and

[codebox]

if($data["job_expired"]=="no")

$value = "<font color=red>".$value."</font>";[/codebox]
Now I have a field that changes based on date and when I view that it does NOT show the html markup
[codebox]//current date - 14 days (14246060)

$curd = date("Y-m-d",strtotime(now())-14
246060);

$str = "<font color=";

if ($value>= $curd)

$str.="green";

Else

$str.="red";

$str.="><b>".$value."</b></font>";

$value=$str;[/codebox]
What am I doing wrong, it looks awful with the code showing in the view record?
TIA

Lori

Alexey admin 10/9/2007

Lori,
your code looks correct.

Publish your project on Demo Account and send a link to it with a problem description to support@xlinesoft.com

I'll help you to get it working.