Guest Posted October 3, 2010 Posted October 3, 2010 Hello all, I have the following set of code in a PHP file and I try to add coding to change the font color but it doesnt work. It either doesnt effect the text or it just sends an error message and messes up the whole sequence of coding. Here is the set of code: { $parts2=Array(); $parts1=Array(); $parts2 = split("\.", $products_price); $parts = split("\\$", $parts2[0]); if($parts[1]<90) { print " <a href='/pages/link3.html' target='_blank'><u><nobr>Random texts here</nobr></u></a><!--<br>Random texts here <font color=yellow>Please Note:Random texts here.--></font>"; } else { print " <a href='/pages/link1.html' target='_blank'><u><b><nobr>Random texts here</nobr></u></b></a><!--<br>Random texts here <font color=yellow>Please Note:Random texts here.--></font>"; } { print " <a href='/pages/link.html' target='_blank'><u><b><nobr>Random texts here</nobr></u></b></a><!--<br>Random texts here! Random texts here <font color=yellow>Please Note: Random texts here.--></font>"; } } ?> <?php if($products_options_name['products_options_name'] == 'Available Texts') { print "<br>Random texts here.<br>Random texts here<br><br>"; } ?>
bowen Posted October 3, 2010 Posted October 3, 2010 not sure if this is the answer but have you tried putting the colour as <font color='yellow'>
Guest Posted October 3, 2010 Posted October 3, 2010 Im trying to change the color of the hyperlinks in this area of the code where the "print" function is: } else { print " <a href='/pages/link1.html' target='_blank'><u><b><nobr>Random texts here</nobr></u></b></a><!--<br>Random texts here <font color=yellow>Please Note:Random texts here.--></font>"; } { print " <a href='/pages/link.html' target='_blank'><u><b><nobr>Random texts here</nobr></u></b></a><!--<br>Random texts here! Random texts here <font color=yellow>Please Note: Random texts here.--></font>"; } }
bowen Posted October 3, 2010 Posted October 3, 2010 you can do it via css... if you enter: .hlink { color: #FF0; } into your stylesheet and enter in your code: <a class="hlink" href='/pages/link1.html' target='_blank'><u><nobr>Random texts here</nobr></u></b></a> then it will show as a yellow link then basically add the class="hlink" to a hyperlink will turn it yellow..or whatever colour you choose,
Guest Posted October 3, 2010 Posted October 3, 2010 yeh thats what I thought. I tried style sheets but it came up with an error. It was getting late though and I was tired. Haha. Thanks
bowen Posted October 3, 2010 Posted October 3, 2010 yeh thats what I thought. I tried style sheets but it came up with an error. It was getting late though and I was tired. Haha. Thanks oh...erm.... did you try swapping the " for ' so its a class='hlink' ? as the " because the href isnt using the " as part of the php code
Guest Posted October 3, 2010 Posted October 3, 2010 oh...erm.... did you try swapping the " for ' so its a class='hlink' ? as the " because the href isnt using the " as part of the php code Your idea isnt working...
bowen Posted October 3, 2010 Posted October 3, 2010 thats strange... i have create a php page with the below code: <link rel="stylesheet" type="text/css" href="test.css"> <? print " <a class='hlink' href='/pages/link3.html' target='_blank'><u><nobr>Random texts here</nobr></u></a>"; ?> with the same css code as before and it displays ok e.g. link example
Recommended Posts
Archived
This topic is now archived and is closed to further replies.