我怎么能自动创建翻滚..我需要当我上传原始图像时自动创建拇指并在文件夹中添加拇指(大小200 x 200)并在数据库中插入拇指路径拇指..我需要帮助..任何一个可以帮我 ?
<?php
error_reporting(0);
if ($_POST['submit'])
{
$name=basename($_FILES['file_upload']['name']);
$t_name=$_FILES['file_upload']['tmp_name'];
$dir='upload';
$image_title=$_POST['image_title'];
$image_details=$_POST['image_details'];
$image_text=$_POST['image_text'];
$cat=$_POST['cat'];
$thumb=$_POST['thumb'];
if(move_uploaded_file($t_name,$dir."/".$name))
{
mysql_select_db ($db_name,$conn);
$qur="insert into images (mid, cid, name, path, image_title, image_details, image_text, thumb, addGby, addGon)
values('','$cat','$name','upload/$name','$image_title','$image_details','$image_text','$thumb','$session_name',now())";
$res=mysql_query($qur,$conn);
echo 'File Upload sussfully';
}
else
{
echo 'upload filed!';
}
}
?>
<form method="post" action="Addgallery.php" enctype="multipart/form-data">
<div class="field">
<label>image : </label>
<input type="file" class="custom-file-input" name="file_upload" id="file_upload" />
</div>
<div class="field fullwidth last">
<input type="submit" name="submit" value="upload" class="bt blue large" />
</div>
</form>
答案 0 :(得分:2)
如果您不想编写自己的代码,请尝试以下
http://phpthumb.sourceforge.net/
答案 1 :(得分:0)
你应该试试imgBrowz0r http://freecode.com/projects/imgbrowz0r 这是一个php编写的插件
Css-tricks也有一个教程。