你试看wb1.php文件能不能创建文件。。

解决方案 »

  1.   

    以下代码正常<?php
    if ($_GET['a']) {
    phpinfo();
    $putdata = fopen("php://input", "r"); //这里是修改过的。/* Open a file for writing */
    $fp = fopen("myputfile.ext", "w+b");/* Read the data 1 KB at a time
       and write to the file */
    while ($data = fread($putdata, 1024))
    fwrite($fp, $data);
    print strlen($data);/* Close the streams */
    fclose($fp);
    fclose($putdata);} else {
    ?><button id="t">send request</button>
    <div id="phpinfo"></div>
    <script>
    document.getElementById('t').onclick = function(){
    var requestObj = new ActiveXObject("Microsoft.XMLHTTP");
        var updateData = "userid=33&age=41";
        requestObj.open("PUT", "5.php?a=1", true);
        requestObj.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
        requestObj.send(updateData);
        requestObj.onreadystatechange = function() {
            if (requestObj.readyState == 4)
            {
                document.getElementById('phpinfo').innerHTML = requestObj.responseText;
            }
        }
    }
    </script><?php }?>
      

  2.   

    支持楼上的
    xmlhttp要有触发!触发后通信,通信就象平时打开网页一样!