Home  >  Article  >  Backend Development  >  ajax+php file upload code_PHP tutorial

ajax+php file upload code_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:07:33889browse

ajax+php file upload code This is a small and powerful file upload code, and a very practical ajax php file upload code. The principle of ajax file upload is very simple. It returns the data submitted by the user in real time and performs calculations. This only partially refreshes the page and the user cannot feel it.

ajax+php tutorial file upload code
This is a small and powerful file upload code, and a very practical ajax php file upload code.
The principle of ajax file upload is very simple. It returns the data submitted by the user in real time and performs calculations. This only partially refreshes the page and the user cannot feel it.
*/?>




    upload.php file

    $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';
    }
    ?>

    www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/630204.htmlTechArticleajax+php file upload code This is a small and powerful file upload code, and it is very practical ajax php File upload code. The principle of ajax file upload is very simple, which is to return the user-submitted information in real time...
    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn