1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
<script type="text/javascript">
var imageList = new Array();
var nomImageList = new Array();
var idImageList = new Array();
<?php
$tableau = array();
$k = 0;
$dir = opendir("../pack_film/");
while($file = readdir($dir)) {
$extension=substr(strrchr($file,'.'),1) ;
if($extension == "png"){
$tableau[$k] = $file;
$id = substr($tableau[$k], 0, strpos($tableau[$k], "_"));
mysql_connect("XXX","root","") or die(mysql_error());
mysql_select_db("exploit") or die(mysql_error());
$req = mysql_query("SELECT nom FROM films WHERE id = '$id'");
$num_rows = mysql_num_rows($req);
if($num_rows > 0){
$donnees = mysql_fetch_assoc($req);
$nom_film = $donnees['nom'];
}
mysql_close();*/
$tableau1[$k] = $nom_film;
$k++;
}
}
closedir($dir);
for($i=0;$i<count($tableau);$i++){
echo 'imageList['.$i.'] = "'.$tableau[$i].'";';
echo 'nomImageList['.$i.'] = "'.$tableau1[$i].'";';
}
?> |
Partager