Home >Backend Development >PHP Tutorial > php中下传图片,路径对,图片路径也能插入数据库中,但就是下传不到放图片的文件夹上

php中下传图片,路径对,图片路径也能插入数据库中,但就是下传不到放图片的文件夹上

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 13:00:37922browse

php中上传图片,路径对,图片路径也能插入数据库中,但就是上传不到放图片的文件夹下
php中上传图片,路径对,图片路径也能插入数据库中,但就是上传不到放图片的文件夹下
------解决方案--------------------
include("../conn/conn.php");

if($_POST["submit"]!==""){
if(!is_dir("/up")){ 
mkdir("/up");
}
$path1="up/".$_FILES["pic1"]["name"];    //图片
move_uploaded_file($_FILES["pic1"]["tmp_name"],$path1);  

$path2="up/".$_FILES["pic2"]["name"];    //图片
move_uploaded_file($_FILES["pic2"]["tmp_name"],$path2);  

$path3="up/".$_FILES["pic3"]["name"];    //图片
move_uploaded_file($_FILES["pic3"]["tmp_name"],$path3);  

$path4="up/".$_FILES["pic4"]["name"];    //图片
move_uploaded_file($_FILES["pic4"]["tmp_name"],$path4);  

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