I want to use php to get Image file information in folder,and dynamic add image in div then add into web page,below is my code,but it does not work, please help me.
index.html
<div class="scrollContainer">
<?php
var $i = 1;
var $panel_id = "panel_";
var $imgUrl = "./Img/";
var $file=NULL;
var $dir = opendir("Img");
while( ($file = readdir($dir)) !== false ){
$panel_id = $panel_id.$i;
$imgUrl = $imgUrl.$file;
echo "$('.scrollContainer').html("
."$('<div/>')"
.".addClass('panel')"
.".id(".$panel_id.")"
.".append("
."$('<div/>')"
.".addClass('inside')"
.".append("
."$('<img/>')"
.".attr('src',".$imgUrl.")"
.")"
.".append("
."$('<p/>')"
.".text(".$file.")"
.")"
.")"
.");";
$panel_id = "panel_";
$imgUrl = "./Img/";
$i = $i + 1;
} // while
closedir( $dir );
?>
<div>
I am new hand, please help me , I appreciate it.