(实用篇)PHP实现的多文件上传类及用法

这篇文章主要介绍了PHP实现的多文件上传类及用法,详细分析了php实现的多文件上传类与具体的使用技巧,需要的朋友可以参考下

1、upFiles.css.php 文件


2、使用方法
uploade.php 文件:

";
 }
 echo "上传成功!";
}else{
 $err = $upfile ->gteerror();
 if(is_array($err)){
 foreach($err as $v1){
  echo $v1,"
";
 }
 }else{
 echo $err;
 }
 //var_dump($err);
}
//var_dump($upfile);
?>

HTML 文件:

<!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>无标题文档</title>
<script type="text/javascript">
function Check(){
 //alert(‘dddd’);
 for(i=1; i<9; i++){
 if(document.getElementById('v'+i).value == '';){
  document.getElementById('v'+i).name = 'uu';
 }
 }
}
</script>
</head>
<body>
<form name="upfile" action="uploade.php" method="post" enctype="multipart/form-data">
<input type="file" name="spic[]" id="v1" /><br/>
<input type="file" name="spic[]" id="v2" /><br/>
<input type="file" name="spic[]" id="v3" /><br/>
<input type="file" name="spic[]" id="v4" /><br/>
<input type="file" name="spic[]" id="v5" /><br/>
<input type="file" name="spic[]" id="v6" /><br/>
<input type="file" name="spic[]" id="v7" /><br/>
<input type="file" name="spic[]" id="v8" /><br/>
<input type="submit" name="sub" value="提交" onclick="return Check()" />
<input type="reset" name="res" value="重填" />
</form>
</body>
</html>

本文来自投稿,不代表科技代码立场,如若转载,请注明出处https://www.cwhello.com/1379.html

如有侵犯您的合法权益请发邮件951076433@qq.com联系删除

(0)
上一篇 2016年10月17日 17:06
下一篇 2016年10月17日 18:01

相关推荐

联系我们

QQ:951076433

在线咨询:点击这里给我发消息邮件:951076433@qq.com工作时间:周一至周五,9:30-18:30,节假日休息