时间:2021-07-01 10:21:17 帮助过:2人阅读
return and try again?click me"; exit; } else{ $filename=explode(".",$_FILES['pic']['name']);//同上,pic需要对应改名 do { $filename[0]=random(10); //用到函数random时,一样要对应改名 $name=implode(".",$filename); //$name1=$name.".Mcncc"; https://www.gxlcms.com/$uploadfile=$uploaddir.$name;//这个https://www.gxlcms.com/$uploadfile就是你要插入数据库相应字段的图片路径,需要相应做变化 } while(file_exists(https://www.gxlcms.com/$uploadfile));//函数名需要对应最变更 if (move_uploaded_file($_FILES['pic']['tmp_name'],https://www.gxlcms.com/$uploadfile))//PIC需要对应最变更 { if(is_uploaded_file($_FILES['pic']['tmp_name']))//pic需要对应做变更 { echo "the Images Upload failed!"; } else { echo "Your file has been uploaded: ";//src=后面也要对应最变更 echo " Continue to upload "; } } } ?>
------解决方案--------------------
一个测试例