將index
AJAX 客戶端頁面代碼
<html>
<body>
<h
<div id=result></div>
<PRE class=js name="code"><SCRIPT LANGUAGE=JavaScript>
// 上傳函數
function btn_send
data = ""
spliter = "
datadata = data + spliter + "rn"
datadata = data + "Content
// datadata = data + "Content
datadata = data + "Content
text = "My name is Wilson Lin
postLength = text
package = data + text + "rn" + spliter + "
alert(package)
// 把XML文檔發送到Web服務器
var xmlhttp = new ActiveXObject("Microsoft
xml("POST"
xml("Content
xml("Content
xml(package);
// 顯示服務器返回的信息
result
}
</SCRIPT>
</PRE>
</body>
</html>
PHP服務器端代碼
<?php
// $_FILES[
// $uploadfile
$uploadfile = "D:/"
copy( $_FILES[
echo "URL: <a http://localhost/"
?>
Upload successed!
From:http://tw.wingwit.com/Article/program/PHP/201311/20905.html