$txt = htmlspecialchars($_GET[value"]);
if (!empty($txt))
$myfile = file_put_contents('test_file.txt', $txt.PHP_EOL , FILE_APPEND | LOCK_EX);
So the above code does not create test_file.txt
Is there a permission I can change? I have free webhosting setup.
Thanks!
i too had some php file issues, was reading a file not writing but im assuming its the same problem, I had to prefix the server path to the file name with
$_SERVER["DOCUMENT_ROOT"]
It’s not working because you are missing a double quote in this line. When coding in PHP, it is best to use a IDE that color-codes your code.
When you pasted your code here, you can tell that the color is off, right? That means you are missing a quote, end tag, bracket, curly bracket, or comma.
This was it thank you!
@Greenreader9 good catch, I actually rewrote this here instead of copy and pasting - silly of me
my original code had both "
oo well spotting, i missed it too!