到PHP手册中找以下函:
move_uploaded_file();
fopen();
fwrite();
自力更生,丰衣足食。

解决方案 »

  1.   

    $x=fopen('test.txt','wt');
    fwrite($x,$_POST['Content']);
    fclose($x);搞定
      

  2.   

    <?php
    $filename = 'test.txt';
    $somecontent = "添加这些文字到文件\n";// 首先我们要确定文件存在并且可写。
    if (is_writable($filename)) {    // 在这个例子里,我们将使用添加模式打开$filename,
        // 因此,文件指针将会在文件的开头,
        // 那就是当我们使用fwrite()的时候,$somecontent将要写入的地方。
        if (!$handle = fopen($filename, 'a')) {
             print "不能打开文件 $filename";
             exit;
        }    // 将$somecontent写入到我们打开的文件中。
        if (!fwrite($handle, $somecontent)) {
            print "不能写入到文件 $filename";
            exit;
        }    print "成功地将 $somecontent 写入到文件$filename";    fclose($handle);} else {
        print "文件 $filename 不可写";
    }
    ?>
      

  3.   

    <?php
      // create short variable names
      $somecontent = $_POST['somecontent'];  $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];if( $somecontent == null)
    {
      echo '你没有输入任何内容!<br />';
    }
    else
    {
      echo '你已输入了信息!<br />';
    }$outputstring = $date."\t".$somecontent."\n";// open file for appending
    @ $fp = fopen("$DOCUMENT_ROOT/1/text.txt", 'ab');flock($fp, LOCK_EX); if (!$fp)
    {
      echo '<p><strong> 不能打开文件.</strong></p>';
      exit;
    } fwrite($fp, $outputstring, strlen($outputstring));
    flock($fp, LOCK_UN); 
    fclose($fp);echo '<p>已写入文件中.....</p>';
    ?>
      

  4.   

    function fileJoin($content, $filename )
    {
    $fp = fopen($filename, 'w+'); if (fwrite($fp, $content) === FALSE) 
    {
            return FALSE;    }else
    {
    chmod($filename, 0777);
    fclose($fp);
            return True;
    }}//End Function直接调用函数就可以 了
      

  5.   

    如果不会php的话那你为什么要用php呢?反正用fopen打开一个文件,然后把传输的文字写进去就行了,没必要多麻烦,建议还是看一下php