font, and alignment of print variables in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
podarum
Forum Commoner
Posts: 51
Joined: Mon Jun 15, 2009 1:36 pm

font, and alignment of print variables in php

Post by podarum »

I need some help, I'm sure someone has done this out there... but, how can I customize the font for each print variable in php..and align all to the same position?

Example :

Code: Select all

 
print "Email Address is : " . $Email; 
print "<br />";
print "Phone used is    : " . $Phone; 
print "<br />";
 
What actually shows up is
Email Address is : blabla@bla.co
Phone used is : 222-222-2222 ,
instead of (in the same horizontal position)
:blabla@bla.com
:222-222-2222

And how can I make let's say the email address with red font and 12px and phone with blue and 14px.
Thanks
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: font, and alignment of print variables in php

Post by requinix »

How familiar are you with HTML?
podarum
Forum Commoner
Posts: 51
Joined: Mon Jun 15, 2009 1:36 pm

Re: font, and alignment of print variables in php

Post by podarum »

I can do all that in html using CSS, but is there a way I can do it directly in php? What are you thinking?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: font, and alignment of print variables in php

Post by requinix »

What you're asking doesn't make sense. PHP doesn't make add colors or effects to text. It merely prints out a bunch of characters: what those characters are and how they're interpreted is what gives color and effects.

What is your target medium? An HTML page or message? A terminal/console?
podarum
Forum Commoner
Posts: 51
Joined: Mon Jun 15, 2009 1:36 pm

Re: font, and alignment of print variables in php

Post by podarum »

I have a form that when a customer inputs his credentials it sends him to a confirm page all in php.
For example :
Your email address is : bla@bla.com
Your Phone is : 222-222-2222

So I need to read these variables from the form.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: font, and alignment of print variables in php

Post by requinix »

Is your question how to change colors and align the text or how to read from a form?

"Confirmation page", so you're using HTML? The simplest way to align them is to use a table. Set a style on the <td> to change colors.
To get fields from the form you should become familiar with this.
podarum
Forum Commoner
Posts: 51
Joined: Mon Jun 15, 2009 1:36 pm

Re: font, and alignment of print variables in php

Post by podarum »

It's how to align them and resize (color) them after I've POSTed them inot my new php page... I got the POST part fine, it's that each variable (or value) looks the same. I could try the table..
Post Reply