Alright, so I have created a Portfolio Page for a Model containing several images, but I want to add a bunch more images using a specific HTML script. As a programmer, I try to eliminate redundancy, but I don't know anything about JavaScript or PHP.
What I want:
Bonus
My Site: ChrisNguyen.ml/Portfolio
Example Code (Other example in raw HTML in a above link):
<?php
$dirname = "images_all";
$images = glob($dirname."*.png");
foreach($images as $image) {
echo '<article class="4u 12u$(xsmall) work-item">
<a href="'.$image'" class="image fit thumb"><img src="'.$image'" alt="" /></a>
<h3> </h3>
</article> ';
}
?>
HTML Block that needs to be repeated:
<article class="4u 12u$(xsmall) work-item">
<a href="images/fulls/01.jpg" class="image fit thumb"><img src="images/fulls/01.jpg" alt="" /></a>
<h3> </h3>
</article>
Other Info: LAMP Server running on AWS EC2 (So I can use PHP, etc)
In case you didn't get it:
Update: It does support PHP because of the SMTP form at the bottom of the page.
Update 2: I am implementing all your guy's suggestions (thanks!), and modifying the HTML page and other files, and testing it with the live server/site. I do see changes in the page, but not the results desired (i.e the page displays the variable name rather than the value "{$dirArray[$index]}")
So the answer above is correct. However, it did not work/execute in the server currently used (Apache) because the server didn't recognize PHP within the HTML itself. That is why it only worked as a separate file. [ How do I add PHP code/file to HTML(.html) files? ]
What I needed to do:
Check my site (ChrisNguyen.ml/Portfolio) for the finished result/code.