代码如下 | 复制代码 |
<script language="网页特效" type="text/网页特效" > //上传大图片显示 function showuploadpic(uploadpic) { if(uploadpic.value!="") { document.getelementbyid('preview').src=uploadpic.value; } } //上传小图片显示 function showuploadpics(uploadpic) { if(uploadpic.value!="") { document.getelementbyid('previews').src=uploadpic.value; } } //上传flash图片 function showuploadflash(uploadpic) { if(uploadpic.value!="") { document.getelementbyid('preview').src=uploadpic.value; } } </script> <form action="up.php?act=add" method="post" enctype="multipart/form-data"> <input type="file" name="flashpic" id="flashpic" onchange="showuploadpic(this)"/><img src="" width="100" height="100" id="preview"/><br /> <input type="file" name="flashpics" id="flashpics" onchange="showuploadpics(this)"/> <img src="" width="100" height="100" id="previews"/> <input name="" type="submit" value="添加" /> </form> <?php //require_once("class/uploadfile.class.php"); if($_request['act']=='add'){ $maximg=$_files['flashpic']; $minimg=$_files['flashpics']; $upload=new uploadfile; $fmaxpath="no_picture.gif"; $fminpath="no_picture.gif"; if(!empty($maximg['tmp_name'])) { $fmaxpath=$upload->upload($maximg,'upfiles/'); } if(!empty($minimg['tmp_name'])) { $fminpath=$upload->upload($minimg,'upfiles/'); } } ?> 首页 1 2 末页 |
时间: 2024-12-24 10:34:36