【发布时间】:2012-06-10 04:50:42
【问题描述】:
假设我的 PHP 代码是
<?php
// Get form variables using POST method
$MarriagePostMortem=stripslashes($_POST['MarriagePostMortem']);
$AutoSavesToKeep=stripslashes($_POST['AutoSavesToKeep']);
// Open and write file
$myFile="S3S.cfg";
$fh = fopen($myFile, 'w+') or die("can't open file");
fwrite($fh, "The Sims 3 Starter Configuration
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
MarriagePostMortem $MarriagePostMortem
AutoSavesToKeep $AutoSavesToKeep
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-");
fclose($fh);
//echo "file written\n";
?>
我想将文件直接发送给用户以供下载,而不将其保存到服务器。我真的不太擅长 PHP,那么我到底需要添加/更改什么?
【问题讨论】: