Lo script sul quale sto lavorando...impazzendo in realtà ...è questo
Codice PHP:
<!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=UTF-8 />
<title>Documento senza titolo</title>
<?php
function dir_reader($dir, &$images, &$subdirs
{
global 
$defdir;
if(
$dir != $defdir)
{
$dir $defdir."/".$dir;
}
if (
$handle opendir($dir)) 
{        
while (
false !== ($file readdir($handle))) 
{
if (
$file != "." && $file != ".."
{
list(
$filename$ext) = explode("."$file);
if(!
is_dir($dir.'/'.$file)) 
{
if(
$ext == "jpg" || $ext == "jpeg")
{
$images[] = $file;
}
}
else
{
$subdirs[] = "[url='?My_Gallery=".$file."']".$file."[/url]";
}
}
}
closedir($handle);
}
}
//Nome della cartella madre
$defdir './My_Gallery';
if(!isset(
$_GET['My_Gallery']))
{
$dir $defdir;
}
else
{
$dir $_GET['My_Gallery'];
}
$images = array();
$subdirs = array();
dir_reader($dir$images$subdirs);
?>
<table border="2">
<tr>
<td>
<?php
// Da rivedere ciclo sull'array $subdirs per creazione automatica di button con funzione random
print("<pre>");
print_r($subdirs);
print(
"</pre>");
if(isset(
$_GET['My_Gallery']))
{
print(
"[url='".$_SERVER[']indietro[/url]");
"
";
}
?>
</td>
<td>
<?php
// Da rivedere ciclo sull'
array $images per ottenere la gallery di immagini
while (list($chiave,$valore)=each($images))
{
echo
"$valore </br>";
echo 
"<img src=$images>";
$numero_elementi=count($images);
echo 
"&numero_elementi=".$numero_elementi;
for (
$i=0;$i<$numero_elementi;$i++)
echo 
'&images_" .$i ."=" .$images[$i]';
}
?>