I am building a picture gallery, that uses this code to display each product I have:
<div class="feature">
<a href="#"><imagetag alt="Image Caption"srcs=""></a>
<div>
<p>
This is some information that can go along with an image.
Anything can be placed here, including images.
</p>
</div>
</div>
I need to create a while loop, that takes all the products in my database, and creates a div of the “feature” class for every instance. I have problems know exactly which symbols need to be escaped and etc. Your help is greatly appreciated.
here is my start:
<?php
($product_set = mysql_fetch_assoc($query)) {
print("<div class="feature"> <a href="#"><imagetage alt="Image Caption" srcs=$product_set[products_image]></a>"
);}
?>
If you are in a string, every doublequote should be escaped. Because it will close your string.
Fun thing is, I got a link from someone on stackOverflow about PHP templating. Which was using Smarty. So you don’t have to use these print states anymore.