Reputation: 54113
Here is my problem.
If I do:
$imagePath = "images/spalt_images/body_images/525A.JPG";
?>
<img src="<?php $imagePath ?>" alt="front image" class="productImage"/>
<?php
Then my image does not show up.
However, if I do:
<img src="images/spalt_images/body_images/525A.JPG" alt="front image" class="productImage"/>
Then my image shows up just fine. Why would it not work with php?
Thanks
Upvotes: 0
Views: 107
Reputation: 18295
Change <?php $imagePath ?>
in your code to <?=$imagePath?>
, or add an echo if your server doesn't allow shorttags.
Upvotes: 0
Reputation: 342635
You need to echo it:
<?php echo $imagePath ?>
or use a short tag (not recommended, but that's another discussion):
<?=$imagePath ?>
Upvotes: 1