<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>無(wú)標(biāo)題文檔</title></head><body><?php $image? = $_FILES['mypicture'];$imageName = $image['name'];$tmp_name = $image['tmp_name'];$error = $image['error'];$dirName = $_POST['dirName'];print_r($image);if(is_uploaded_file($tmp_name)){?if(is_dir($dirName))?{????? chdir($dirName);????? $path = $dirName.'/'.$imageName;?????? move_uploaded_file($tmp_name,$path);??? echo "<img src='".$path."'>";????}?else?{?? mkdir($dirName,0777);?? chdir($dirName);?? $path = $dirName.'/'.$imageName;????? move_uploaded_file($tmp_name,$path);?? echo "<img src='".$path."'>";?}}?><form action="" method="post" enctype="multipart/form-data"><input type="file" name="mypicture" accept="image/gif , image/jpeg , image/jpg , image/png" />上傳到文件夾名稱(chēng):<input type="text" name="dirName" /><input type="submit" name="bnt" value="上傳" /></form></body></html>
添加回答
舉報(bào)
0/150
提交
取消