Question on HTML inside 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
admaster
Forum Newbie
Posts: 12
Joined: Tue Nov 28, 2006 7:16 pm

Question on HTML inside PHP

Post by admaster »

I have this code:

Code: Select all

<? 
if($logged_in){
//stuff goes here
}
?>
where I have marked:

//stuff goes here

I want html tags.
How do I do that?

It creates errors when I do that...
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post by Zoxive »

Code: Select all

<?php
if($logged_in){
print '<strong>Bold Text</strong>';
}
?>
or

Code: Select all

<?php
if($logged_in){
?>
<strong>Bold Text</strong>
<?php
}
?>
I Prefer the first one.
Post Reply