最简单的上传php文件 php多图上传插件( 五 )


case 8:
$posX=($groundInfo[“width”]-$waterInfo[“width”])/2;
$posY=$groundInfo[“height”]-$waterInfo[“height”];
break;
case 9:
$posX=$groundInfo[“width”]-$waterInfo[“width”];
$posY=$groundInfo[“height”]-$waterInfo[“height”];
break;
case 0:
default:
$posX=rand(0, ($groundInfo[“width”]-$waterInfo[“width”]));
$posY=rand(0, ($groundInfo[“height”]-$waterInfo[“height”]));
break;
}
return array(“posX”=>$posX, “posY”=>$posY);
}
}
第三步:上传表单
<form action=”upload.php” method=”post” enctype=”multipart/form-data”>
pic: <input type=”file” name=”pic”><br>
<input type=”submit” name=”sub” value=https://www.520longzhigu.com/diannao/”uploadpicture”>
</form>
第四步:上传处理
<?php
/*
功能:上传图片到指定路径”./images/”下
并对指定路径下的图片做图像处理操作!
*/
include “FileUpload.class.php”;
include “image.class.php”;
$up=new FileUpload(array(“filepath”=>”./images/”, “allowtype”=>array(“gif”, “jpg”, “png”)));
if($up->uploadFile(“pic”)){
$filename=$up->getNewFileName();
$img=new Image(“./images/”);
$th_filename=$img->thumb($filename, 300, 300, “th_”);
$img->waterMark($th_filename, “gaolf.gif”, 5, “wa_”);
$img->waterMark($filename, “gaolf.gif”, 0, “”);
}else{
echo $up->getErrorMsg();
}


以上关于本文的内容,仅作参考!温馨提示:如遇健康、疾病相关的问题,请您及时就医或请专业人士给予相关指导!

「四川龙网」www.sichuanlong.com小编还为您精选了以下内容,希望对您有所帮助: