php處理上傳文本文件

if(file_put_contents($_POST["name"],$_POST["content"],FILE_APPEND)){
$res = copy($_POST["name"],"../TXTFILE".$_POST["name"])
if($res){
if(unlink($_POST["name"])){
echo '操作完成';
}
}else{
echo '文件移動失敗';
}
}else{
echo '文件寫入失敗';
}

<?php
    header ('Content-Type: text/html; charset=GB2312');
    echo file_put_contents('TXTFILE/'.$_POST["name"] , $_POST["content"] , FILE_APPEND);
?>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章