使用php创建动态文件夹及其缩略图

时间:2012-03-01 01:37:53

标签: php

我正在动态创建一个文件夹,我也希望显示该文件夹的缩略图。

这是我的index.php:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<div id="pictures">
<form id="pic_form" method="post" action="pictures.php">
<table align="center" width="500" cellpadding="0" cellspacing="0" border="0">
   <tr>
   <td width="50px" align="center"/>
   <td width="100px" align="center">Folder Name::
   <td>
   <td width="50px" align="center"/>
   <td width="100px" align="center">
   <input type="text" id="foldername" name="foldername">
   <td>
   <td width="50px" align="center"/>
   <td width="100px" align="center">
   <input type="submit" name="submit" value="Create">
   <td>
   <td width="50px" align="center"/>
   </tr>
</table>
</form>
</div>
</body>
</html>

现在这是我的照片.php:

<?php
$foldername=$_POST['foldername'];
mkdir("album/$foldername");
//now what to do to generate thumbnail of the folder in the body segment;
//my concept ends here;
?>
<html>
<head>
</head>
<body>
</body>
</html>

1 个答案:

答案 0 :(得分:1)

<img src="folder.gif"> <?php echo $_POST['foldername']; ?>

从某处获取文件夹图标并使用<img>元素显示它。结果如下所示:

  

enter image description here Foobar