利用form表单的target属性和iframe
一、上传文件的一个php方法
该方法接受一个$file参数,该参数为从客户端获取的$_files变量,返回重新命名后的文件名,如果上传失败,则返回空字符串,php代码如下:
function uploadfile($file) {
// 上传路径 $destinationpath = "./upload/";
if (!file_exists($destinationpath)){
mkdir($destinationpath , 0777); }
//...