- Joined
- Aug 21, 2023
- Messages
- 40
- Reaction score
- 0
Hi.
I have a simple php
When I open in browser I get the message "Failed to create file". How can I fix this? Thanks.
I have a simple php
PHP:
<?php // testfile.php
$fh = fopen("testfile.txt", 'w') or die("Failed to create file");
$text = <<<_END
Line 1
Line 2
Line 3
_END;
fwrite($fh, $text) or die("Could not write to file");
fclose($fh);
echo "File 'testfile.txt' written successfully";
?>
When I open in browser I get the message "Failed to create file". How can I fix this? Thanks.