Hey everyone. I've begun working with PHP recently, and have been using some online tutorials to help me along.
My problem, obviously, has to do with PHP's file system. I copied the PHP in the following piece of code directly from an online tutorial:
<html>
<head>
<title>test page 2</title>
</head>
<body>
<?php
$ourFileName = "testFile.txt";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fclose($ourFileHandle);
?>
</body>
</html>
I don't see any reason for the code not to work. However, when I open the file in my browser, it outputs "can't open file". Also, the file "testFile.txt" does not appear in the directory, like it is supposed to.
I would appreciate it if anyone could help me find the source of my problem.
Thanks a lot! 😃