Home>Article>Backend Development> PHP implements avatar upload preview function_php example

PHP implements avatar upload preview function_php example

墨辰丷
墨辰丷 Original
2018-05-23 14:19:19 1891browse

This article mainly introduces the relevant information of PHP to implement the avatar upload preview function in detail. It has certain reference value. Interested friends can refer to

Main page 1.php


   上传头像  

//头像显示的位置

Processing page 2.php


alert('该文件已存在!');"; } else { move_uploaded_file($_FILES["file"]["tmp_name"],$filename); unlink($_POST["tp"]); echo ""; } } }

Open the display:

Click the picture location to pop up the selection box:

After selecting the picture:

The above is the entire content of this article, I hope it will be helpful to everyone's study.


Related recommendations:

PHPThe difference between abstract and interface_javascript skills

php displays the file where the current file is located and all the files in the folder are expanded in a tree shape_javascript skills

php example of cross-domain calling json _jquery

The above is the detailed content of PHP implements avatar upload preview function_php example. For more information, please follow other related articles on the PHP Chinese website!

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