开发者

Save to file not working for following PHP code

i have the following code which stopped working recently. The problem is that no data is written to the text file "testFile.txt"

Hi, i have the following code which stopped working recently. The problem is that no data is written to the text file "testFile.txt"

<?php
$myFile = "testFile.txt";
$fh = fopen($myFile, 'a');
$IP = $_SERVER["REMOTE_ADDR"].',';
$logdetails=  $IP.date("F j, Y, g:i a O T");
$stringTimeout = $_POST['_delay'];
$stringData1 = $_POST['userChoices'];
$s = ',';
$postData = $s.$stringTimeout.$s.$stringData1."\n";
fwrite($fh,$logdetails.$postData, 'a');
fclose($fh);
header("Location: http://www.google.com");

ex开发者_如何学运维it;
?>

Any ideas why this might be??

Thanks!


Remove , 'a' in fwrite($fh,$logdetails.$postData, 'a');. See this document. :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜