- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 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
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
echo "<body>";
echo "<h1>Картинки</h1>";
//$num =$_GET[num];
$start = 0 ;
$start=$_GET['start'];
$ls_dir = $_GET ['ls_dir'];
if (!isset($ls_dir ))
{
$ls_dir ="./pictures" ;
}
$num =10;
if (!isset($start))
{
$start =0 ;
}
echo "$ls_dir";
$dir = `ls $ls_dir | awk '/\.[a-zA-Z][a-zA-Z][a-zA-Z][a-zA-Z]?$/ {print "&&&" $1}'`;
$fold_dir = `ls -l $ls_dir | awk '/^d/ {print "&&&" $9}'`;
$pic_list = explode("&&&",$dir);
$dir_list =explode("&&&",$fold_dir);
echo "$fold_dir";
?>
<h3>Доступные папки</h3>
<ul>
<?php
for ($i=1;$i< count($dir_list);$i++)
{
$cur_val=$ls_dir."/".$dir_list[$i];
echo "<li>";
echo "<a href=pictures.php?start=0&ls_dir=$cur_val>";
//echo $cur_val;
echo "<img src=fold_im.JPG width=34 height=49 />";
// echo "&start=";
// echo $start;
// echo ">";
echo $dir_list[$i];
echo "</a>";
echo "</li>";
}
?>
</ul>
<table width="100%" border="1">
<tr>
<td width="10%">
</td>
<td><h1>Картинки из папки <?php echo $ls_dir ?></h1>
</td>
</tr>
<?php
for ($i = $start +1;($i<$start +1+ $num)&&($i<count($pic_list));$i++)
{
echo "<tr>";
echo "<td width =10% > </td>";
$pic = $ls_dir."/".$pic_list[$i];
echo "<td>";
echo "<a href = $pic><img src=$pic/><a/>";
echo "</td>";
echo "</tr>";
}
?>