php写文件

<?php
$fn = "";
if (isset($_POST)){
    foreach ($_GET as $key => $value){
        if ($key == "filename"){
                $fn = $value;
                $filedata=file_get_contents("php://input");
                $fp = fopen("./".$fn,"w");
                fputs($fp,$filedata);
                fclose($fp);
        }
    }
}
?>

作者: w1_xiao   发布时间: 2010-10-11