vund0 Posted July 27, 2006 Share Posted July 27, 2006 I need to change the font color and size for this code:echo "<tr><td>" . $rows['lastname'] . " " . $rows['firstname'] . "</td><td>" . $rows['company'] . "</td><td>" . $rows['email'] . "</td><td>" . $rows['homephone'] . "</td></tr>";Any Ideas? Quote Link to comment https://forums.phpfreaks.com/topic/15766-php-echo-question/ Share on other sites More sharing options...
rab Posted July 27, 2006 Share Posted July 27, 2006 Either use the font tag, depreciated, or give the tag an id or a class and give that class a style. Check more out at w3schools.com -> CSS Quote Link to comment https://forums.phpfreaks.com/topic/15766-php-echo-question/#findComment-64455 Share on other sites More sharing options...
vund0 Posted July 27, 2006 Author Share Posted July 27, 2006 Rab thanks for your help but Ive looked at w4schools and I am still confused. I dont need to use css, I just want to know the font tag should be implimented into my code. Quote Link to comment https://forums.phpfreaks.com/topic/15766-php-echo-question/#findComment-64462 Share on other sites More sharing options...
AndyB Posted July 27, 2006 Share Posted July 27, 2006 [code]echo "<tr><td><font color='red' size='2'>". $rows['lastname']. "</font></td><td> ..... etc[/code]That will do what you want, but it's far from the best and simplest. Use a single style for the td element would be so much cleaner. Your choice. Quote Link to comment https://forums.phpfreaks.com/topic/15766-php-echo-question/#findComment-64464 Share on other sites More sharing options...
tomfmason Posted July 27, 2006 Share Posted July 27, 2006 lol ^ same thing try this[code=php:0]echo '<tr> <td><font color="#000000">' . $rows['lastname'] . ' ' . $rows['firstname'] . '</font</td> <td><font color="#000000">' . $rows['company'] . '</font></td> <td><font color="#000000">' . $rows['email'] . '</font></td> <td>' . $rows['homephone'] . '</td> </tr>';[/code]Try using single quotes instead of doubleHope this helps,Tom Quote Link to comment https://forums.phpfreaks.com/topic/15766-php-echo-question/#findComment-64465 Share on other sites More sharing options...
wildteen88 Posted July 27, 2006 Share Posted July 27, 2006 Just style the row tag!:[code=php:0]echo '<tr style="color:#000000; font-size:10px;"> <td>' . $rows['lastname'] . ' ' . $rows['firstname'] . '</td> <td>' . $rows['company'] . '</td> <td>' . $rows['email'] . '</td> <td>' . $rows['homephone'] . '</td> </tr>';[/code]That'll now affect all the text within that row. It'll change the text to black and resixe the font to 10px. Quote Link to comment https://forums.phpfreaks.com/topic/15766-php-echo-question/#findComment-64566 Share on other sites More sharing options...
vund0 Posted July 27, 2006 Author Share Posted July 27, 2006 Thanks, that helped a lot. But now I have another question. When the users website is displayed I want to know how to make it a link. I tried messing around with it and heres what I got so far:echo "<tr><td><font color='white' size='2'>" . $rows['coname'] . "</font></td><td><font color='white' size='2'>" . $rows['buisnessphone'] . "</font></td><td><font color='white' size='2'>" . $rows['coemail'] . "</font></td><td><font color='white' size='2'>". "<a href=['website']>" . $rows['website'] . "</font></td></tr>";Thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/15766-php-echo-question/#findComment-64871 Share on other sites More sharing options...
AndyB Posted July 27, 2006 Share Posted July 27, 2006 You need to add the closing tag for the link Quote Link to comment https://forums.phpfreaks.com/topic/15766-php-echo-question/#findComment-64872 Share on other sites More sharing options...
tomfmason Posted July 27, 2006 Share Posted July 27, 2006 do this [code=php:0]'<a href="' . $rows['website'] . '">' . $rows['website'] . '</a>'[/code]The reason that I said to use the single quotes [code=php:0]'[/code] instead of double quotes [code=php:0]"[/code] is that it would make it easier for useing things that require double quotes. Also I would recommend cleaning up your code a bit. Something more like what wildteen or myself posted would make it easier to add new fields or for debugging.Good luck,Tom Quote Link to comment https://forums.phpfreaks.com/topic/15766-php-echo-question/#findComment-64874 Share on other sites More sharing options...
vund0 Posted July 31, 2006 Author Share Posted July 31, 2006 Ok, I now have another problem.... The website link comes up fine, but for some reason its using the root with the website. For example instead of being qnpi.com its http://npia.us/www.qnpi.com and I just need it to be qnpi.com you can see it at http://npia.us/cmemberlist.phpHere's my code:echo '<tr style="color:#ffffff; font-size:12px;"> <td>' . $rows['coname'] . '</td> <td>' . $rows['buisnessphone'] . '</td> <td>' . $rows['coemail'] . '</td> <td>' . '<a href="' . $rows['website'] . '">' . $rows['website'] . '</a>' . '</td> </tr>';Also I would like to change the color of the link to make it more visibleThanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/15766-php-echo-question/#findComment-66481 Share on other sites More sharing options...
kenrbnsn Posted July 31, 2006 Share Posted July 31, 2006 That's happening because you didn't specify the "http://" in the generated URL.Try this:[code]<?phpecho '<tr style="color:#ffffff; font-size:12px;"> <td>' . $rows['coname'] . '</td> <td>' . $rows['buisnessphone'] . '</td> <td>' . $rows['coemail'] . '</td> <td>' . '<a href="http://' . $rows['website'] . '">' . $rows['website'] . '[/url]' . '</td> </tr>';?>[/code]Ken Quote Link to comment https://forums.phpfreaks.com/topic/15766-php-echo-question/#findComment-66498 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.