I need to loop a html code with php so it will display a list if messages results if it is possible?
I found this code on google? i couldnt understand it:
$brush_price = 5;
echo "<table border=\"1\" align=\"center\">";
echo "<tr><th>Quantity</th>";
echo "<th>Price</th></tr>";
for ( $counter = 10; $counter <= 100; $counter += 10) {
echo "<tr><td>";
echo $counter;
echo "</td><td>";
echo $brush_price * $counter;
echo "</td></tr>";
echo "</table>";
}
I just need it to duplicate a div which is
<div class="news" align="center" style="width:900px;height:65px;background-color:#C8C8C8">
<h3> From: ..... </h3></br>
<p1> Message: Thank you for registering... </p1>
</div>
and i need to loop it for home much messages he has
Although, as @mc10 stated,
<p1>is not a valid HTML tag. This code will duplicate that HTML ten times. To change the number of times it duplicates, change the number in the loop ($i < 10).The sample code is a basic for loop, like I used here. The manual on the
forcontrol structure is here:http://php.net/for
I recommend that you read a tutorial on the basics of PHP.
http://devzone.zend.com/article/627