Current location: Hot Scripts Forums » Programming Languages » PHP » html tags in php


html tags in php

Reply
  #1 (permalink)  
Old 07-10-06, 07:12 AM
n3wb!e's Avatar
n3wb!e n3wb!e is offline
Wannabe Coder
 
Join Date: Mar 2006
Posts: 216
Thanks: 2
Thanked 0 Times in 0 Posts
html tags in php

hi everyone, is it possible to change the font color of the following ?

PHP Code:

...

......
.........
echo 
"Position: $pos";
echo 
"<br>";
echo 
"Job Location: $location";
echo 
"<br>";
echo 
"Salary: $sal";
echo 
"<br>";
echo 
"Job validity: $validity";
echo 
"<br>";
echo 
"Job Level: $level";
echo 
"<br>";
echo 
"Required Skillset: $skill";
echo 
"<br>";
echo 
"Minimum Experience: $min";
echo 
"<br>";
echo 
"Maximum Experience: $max"
can i change the font colors of $pos,$location,$sal,... using <font color="blue"> ? i have tried so many times.

i even tried
PHP Code:

echo "Position: ";

echo 
"<font color="blue">";
echo 
"$pos";
echo 
"</font>";
echo 
"<br>"
but i am getting the following error..
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

can anyone plz tellme how to use html tags in echo statements.

Code:
echo "i have 3 <font color="red"> apples</font> !";
<<< i m sure that isnt possible. i just want to know can it be done ?
well, thank you all for your time.. thanks in advance.. adios.
Reply With Quote
  #2 (permalink)  
Old 07-10-06, 07:25 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
You have to escape the quotes.
PHP Code:

echo "<font color=\"blue\">"
Either you do that, or you can use single quotes.
PHP Code:

echo '<font color="blue">'
Or you can switch to HTML mode
PHP Code:

<?php


// Some PHP code...
?>

Position: <font color="blue"> <?php echo $pos?></font><br>

<?php

// More PHP code of you want...
?>
Reply With Quote
  #3 (permalink)  
Old 07-10-06, 07:41 AM
n3wb!e's Avatar
n3wb!e n3wb!e is offline
Wannabe Coder
 
Join Date: Mar 2006
Posts: 216
Thanks: 2
Thanked 0 Times in 0 Posts
thanks a zillion !!!!!!!!!!!!!
Reply With Quote
  #4 (permalink)  
Old 07-12-06, 10:00 AM
Acecool's Avatar
Acecool Acecool is offline
Aspiring Coder
 
Join Date: Nov 2003
Posts: 506
Thanks: 0
Thanked 0 Times in 0 Posts
I would reccomend...

echo 'Position: <font color="blue">' . $pos . '</font>';

and so on...
__________________
Check Acecoolco.com for PHP Tutorials, and other tuts
If you plan on contacting me, please read this: Legal Terms & Conditions
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
html tutoral thefrtman HTML/XHTML/XML 5 04-27-09 10:25 AM
Display PHP in HTML page using JS scott2500uk PHP 6 05-18-06 12:25 PM
PHP to generate HTML as loaded from client side mgscom PHP 2 01-14-06 12:02 AM
PHP multi-dimensional array sorting issue aqw PHP 2 06-24-05 11:09 PM
Please help insert html into php idforforums PHP 5 04-06-05 11:29 PM


All times are GMT -5. The time now is 07:20 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.