一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

ajax文件上传

时间:2010-09-26 编辑:简简单单 来源:一聚教程网

 代码如下 复制代码





ajax<a target="_blank" href="/tags.php/php文件上传/">文件上传</a>



php教程" method="post" enctype="multipart/form-data" target="upload_target" onsubmit="javascript:return startupload();" >
    
    
         
      
       
    

    
    
 (可上传 gif,jpg,png)


upload.php

 代码如下 复制代码

   $destination_path = '../../upfile/jianjulogo/';//getcwd().directory_separator;

   $result = 0;
  
   $target_path = $destination_path . basename( $_files['myfile']['name']);

   if(@move_uploaded_file($_files['myfile']['tmp_name'], $target_path)) {
      $result = 1;
   }
   echo $target_path;
   sleep(1);


?>

热门栏目