I want to make HTML code that has PHP embedded. The PHP code allows me to display pictures from a specific folder in /var/www/html/images. When the extension is .php for the file it works but when I change it to HTML it doesn't. I really need it in HTML format but images aren't displaying I receive this
Code is shown below:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Gallery from Folder Demo</title>
<style type="text/css">
<!--
li{
list-style-type:none;
margin-right:10px;
margin-bottom:10px;
float:left;
}
-->
</style>
<form>
<input type="button" value="Return to Menu"
onclick=window.history.go(-2);
</form>
</head>
<body>
<ul>
<?php
$dirname = "images/";
$images = scandir($dirname);
arsort($images);
$ignore = array(".", "..");
foreach($images as $curimg){
if(!in_array($curimg, $ignore)) {
echo "<li><a href=\"$dirname$curimg\"><img src='img.php?src=$dirname$curimg&w=300&zc=1' alt='' /></a></li>\n ";
}
}
?>
</ul>
</body>
</html>
Thanks in advance.