php within php not working

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
kevrelland
Forum Commoner
Posts: 73
Joined: Mon Jan 08, 2007 7:41 am

php within php not working

Post by kevrelland »

can anyone help me the prod price is not showing inside my conditional region, and i can't think why?

Code: Select all

<?php if ($row_product_listing['prod_special'] == y)
{
echo ' <p class="price_special">Offer price &pound;<?php echo $row_product_listing["prod_price"]; ?></p> ';
}
 ?>
Cheers
Kevin
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: php within php not working

Post by papa »

Code: Select all

 
<?php 
if($row_product_listing["prod_special"] == y) {
    echo ' <p class="price_special">Offer price &pound;'.$row_product_listing["prod_price"].'</p> ';
}
?>
 
Well you already have the php tags open so no need to open them again. And be consequent with your " " and ' '.
kevrelland
Forum Commoner
Posts: 73
Joined: Mon Jan 08, 2007 7:41 am

Re: php within php not working

Post by kevrelland »

Brilliant thanks
works a treat
kev
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: php within php not working

Post by papa »

no probs!
Post Reply