內容面板收納
客戶需要上傳一個的產品,
要實現jQuery的$.ajax()與php后台交互,進行圖片上傳並刪除
看完結果看代碼,代碼好理解:
index.html
姓名:
年齡:
性別:
選擇圖片:
提交 刪除圖片
年齡:
性別:
選擇圖片:
提交 刪除圖片
結果:
上傳圖片的server.php
$username,'age'=>$age ,'sex'=>$sex,'file'=>$filePath); //轉換成數組類型
$json= json_encode($json_array); //將數組轉換成json對象
echo $json;
//echo $filesName;
?>
刪除圖片的delete.php
