simon_c Posted October 8, 2006 Share Posted October 8, 2006 HiI've been using PHPmaker, so cheated and don't know any PHP code reallyI just want the following to change the colour to red to highlight the fact that an order has not been paid for yet, perhaps the text should be bold as wellCan any one add style="color: #FF0000;" To<?php if ($x_Date_funds_received == "") $x_Date_funds_received = "Out standing"; echo FormatDateTime($x_Date_funds_received,5); ?> This would be a great help and finish this project ofMany thanks Simon Link to comment https://forums.phpfreaks.com/topic/23357-change-colour-of-text-after-an-if-statement/ Share on other sites More sharing options...
redarrow Posted October 8, 2006 Share Posted October 8, 2006 example only.[code]<head><style type="text/css">P{color:#ff0000;font-weight: bold;}</style></head><?php if ($x_Date_funds_received == "") $x_Date_funds_received = "<P>Out standing</p>"; echo FormatDateTime?>[/code] Link to comment https://forums.phpfreaks.com/topic/23357-change-colour-of-text-after-an-if-statement/#findComment-105861 Share on other sites More sharing options...
redarrow Posted October 8, 2006 Share Posted October 8, 2006 [code]<?php if ($x_Date_funds_received == "") $x_Date_funds_received = "<b><P color='#ff0000'>Out standing</p></b>"; echo FormatDateTime?>[/code][code]<?php$text="<b><P color='#ff0000'>Out standing</p></b>"; if ($x_Date_funds_received == "") $x_Date_funds_received = $text; echo FormatDateTime?>[/code] Link to comment https://forums.phpfreaks.com/topic/23357-change-colour-of-text-after-an-if-statement/#findComment-105862 Share on other sites More sharing options...
simon_c Posted October 8, 2006 Author Share Posted October 8, 2006 Many thanks that's brilliant Link to comment https://forums.phpfreaks.com/topic/23357-change-colour-of-text-after-an-if-statement/#findComment-105867 Share on other sites More sharing options...
redarrow Posted October 8, 2006 Share Posted October 8, 2006 I will be relising a css tutoral for those that find it hard soon ok, just add me to your buddy list ok.good luck. Link to comment https://forums.phpfreaks.com/topic/23357-change-colour-of-text-after-an-if-statement/#findComment-105871 Share on other sites More sharing options...
simon_c Posted October 8, 2006 Author Share Posted October 8, 2006 Spoke to soon, can get it bold but not red$text="<b><P color='#ff0000'>Out standing</p></b>";if ($x_Date_funds_received == "") $x_Date_funds_received = $text; echo FormatDateTime($x_Date_funds_received,5);I can't modify the header as this is set by PHPmaker and causes errorsAny ideas why it will not pick up on the text colour ? Link to comment https://forums.phpfreaks.com/topic/23357-change-colour-of-text-after-an-if-statement/#findComment-105884 Share on other sites More sharing options...
redarrow Posted October 8, 2006 Share Posted October 8, 2006 Try simple name color red.[code]$text="<P color='red'>Out standing</p>";if ($x_Date_funds_received == "") $x_Date_funds_received = $text; echo FormatDateTime($x_Date_funds_received,5);[/code] Link to comment https://forums.phpfreaks.com/topic/23357-change-colour-of-text-after-an-if-statement/#findComment-105888 Share on other sites More sharing options...
AndyB Posted October 8, 2006 Share Posted October 8, 2006 [code]$text="<p style='color:#f00; font-weight:bold;'>Outstanding</p>";[/code]That should do it for you (or point the way to what you want) Link to comment https://forums.phpfreaks.com/topic/23357-change-colour-of-text-after-an-if-statement/#findComment-105893 Share on other sites More sharing options...
redarrow Posted October 8, 2006 Share Posted October 8, 2006 andy quick quistion is that example classed as a inline css. Link to comment https://forums.phpfreaks.com/topic/23357-change-colour-of-text-after-an-if-statement/#findComment-105894 Share on other sites More sharing options...
AndyB Posted October 8, 2006 Share Posted October 8, 2006 [quote author=redarrow link=topic=110883.msg448901#msg448901 date=1160322371]andy quick quistion is that example classed as a inline css.[/quote]Yes indeed. Link to comment https://forums.phpfreaks.com/topic/23357-change-colour-of-text-after-an-if-statement/#findComment-105896 Share on other sites More sharing options...
redarrow Posted October 8, 2006 Share Posted October 8, 2006 thank you. Link to comment https://forums.phpfreaks.com/topic/23357-change-colour-of-text-after-an-if-statement/#findComment-105900 Share on other sites More sharing options...
simon_c Posted October 8, 2006 Author Share Posted October 8, 2006 $text="<b><P color='red'>Unpaid</p></b>";if ($x_Date_funds_received == "") $x_Date_funds_received = $text; echo FormatDateTime($x_Date_funds_received,5);Still shows in black text, don't worry 'Bold' is good enough to highlight the upaid accounts. Must be contradicting other code for the text colour set by PHPmaker.Thanks for your help Link to comment https://forums.phpfreaks.com/topic/23357-change-colour-of-text-after-an-if-statement/#findComment-105905 Share on other sites More sharing options...
redarrow Posted October 8, 2006 Share Posted October 8, 2006 ok mate that why i use my relly good trust worvy notepad Link to comment https://forums.phpfreaks.com/topic/23357-change-colour-of-text-after-an-if-statement/#findComment-105907 Share on other sites More sharing options...
mainewoods Posted October 8, 2006 Share Posted October 8, 2006 [code]if ($x_Date_funds_received == "") echo '<span style="color:red;">Amount Outstanding</span>';else echo FormatDateTime($x_Date_funds_received,5);[/code] Link to comment https://forums.phpfreaks.com/topic/23357-change-colour-of-text-after-an-if-statement/#findComment-105980 Share on other sites More sharing options...
simon_c Posted October 11, 2006 Author Share Posted October 11, 2006 You beauty - that fixed it Thanks mainewoods Link to comment https://forums.phpfreaks.com/topic/23357-change-colour-of-text-after-an-if-statement/#findComment-107524 Share on other sites More sharing options...
mainewoods Posted October 11, 2006 Share Posted October 11, 2006 you are welcome Link to comment https://forums.phpfreaks.com/topic/23357-change-colour-of-text-after-an-if-statement/#findComment-107590 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.