开发者

Save to file not working for following PHP code

开发者 https://www.devze.com 2023-03-13 14:31 出处:网络
i have the following code which stopped working recently. The problem is that no data is written to the text file \"testFile.txt\"

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

精彩评论

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