Jump to content


Photo

I need help!


  • This topic is locked This topic is locked
4 replies to this topic

#1 dsartain

dsartain
  • Members
  • PipPipPip
  • Advanced Member
  • 68 posts

Posted 13 March 2006 - 03:25 AM

RESOLVED!!!!!

Hey, I'm trying to use PHP to control font properties by having PHP pull info from a DB that someone submitted. They go to one page, fill out a form with the font face, color, and weight, submit that to the DB, then index.php pulls the info from the DB. I've used the echo to verify that the info is being pulled from the DB, and it is. I've gotten the face and color to work with:

<font face=" <?php echo $font ?>" color= "<?php echo $color ?>" ><br /><?php echo $nicetext; ?><!--Whatever you want to put here!!!!!--></font>

but I don't know how to do the weight...bold, italic, etc...

Can anyone help with this???

#2 keeB

keeB
  • Staff Alumni
  • Advanced Member
  • 1,078 posts
  • LocationCalifornia

Posted 13 March 2006 - 03:32 AM

[!--quoteo(post=354394:date=Mar 13 2006, 03:25 AM:name=Don)--][div class=\'quotetop\']QUOTE(Don @ Mar 13 2006, 03:25 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hey, I'm trying to use PHP to control font properties by having PHP pull info from a DB that someone submitted. They go to one page, fill out a form with the font face, color, and weight, submit that to the DB, then index.php pulls the info from the DB. I've used the echo to verify that the info is being pulled from the DB, and it is. I've gotten the face and color to work with:

<font face=" <?php echo $font ?>" color= "<?php echo $color ?>" ><br /><?php echo $nicetext; ?><!--Whatever you want to put here!!!!!--></font>

but I don't know how to do the weight...bold, italic, etc...

Can anyone help with this???
[/quote]

<font style="font-weight: bold; text-decoration: underline"> ETCCCCCCCCCC.

good luck

Come visit my site to see my latest projects
http://nick.stinemates.org/wordpress/


#3 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 13 March 2006 - 05:00 AM

Actually, you shouldn't use the <font> tag at all, but the <span> & </span> tags with the style="" option.
Read up on CSS for all the information.

Ken

#4 phporcaffeine

phporcaffeine
  • Members
  • PipPipPip
  • Advanced Member
  • 361 posts
  • LocationOhio, USA

Posted 13 March 2006 - 05:17 AM

[!--quoteo(post=354406:date=Mar 13 2006, 12:00 AM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Mar 13 2006, 12:00 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Actually, you shouldn't use the <font> tag at all, but the <span> & </span> tags with the style="" option.
Read up on CSS for all the information.

Ken
[/quote]

Unless you want W3C to spank you!

P.S I noticed in your above code you had <?php $font ?> Don't forget that it needs to be <?php $font; ?> I assume that was just a post typo though.
Thanks,

Ryan Huff
President & Founder, MyCodeTree
support@mycodetree.com | http://mycodetree.com

#5 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 13 March 2006 - 02:57 PM

If you have only one statement between the PHP tags "<? ?>", you don't need the terminating semi-colon since the "?>" closes the statement. See [a href=\"http://www.php.net/manual/en/language.basic-syntax.instruction-separation.php\" target=\"_blank\"]http://www.php.net/manual/en/language.basi...-separation.php[/a] for an explanation. This is one of the quirks in PHP along with not needing braces surrounding a statement block, if there is only one statement in the block. See [a href=\"http://ww.php.net/manual/en/language.control-structures.php\" target=\"_blank\"]http://ww.php.net/manual/en/language.control-structures.php[/a] for an explanation.

Ken




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users