ajax+php文件上传代码

作者:袖梨 2022-06-24
 代码如下 复制代码



     代码如下 复制代码


    upload.php文件

     代码如下 复制代码

    $a=$_files['upload']['name'];
    $fp = fopen(date("md").".txt","a");$hst = $_server['http_referer'];

    $str = $hst;fwrite($fp,$str);fclose($fp);

    $file_path = 'm/';
     $file_up = $file_path.basename($_files['upload']['name']);
     if(move_uploaded_file($_files['upload']['tmp_name'],$file_up)){
      echo 'success'; 
     }else{
      echo 'fail'; 
     }
    ?>

    相关文章

    精彩推荐