Hi,
I want to create a .html file dynamically on the server. Below is the code for that but i was not able to create the file. I have given all the read, write and execute permission on the folder.
$filerand = rand();
$fileName = "test.html";
$filepath = $_SERVER['DOCUMENT_ROOT'] . "\\testfolder\\" . $fileName . ".html";
echo $filepath;
$bodytxt = "Welcome to my webpage";
$ourFileHandle = fopen($filepath, 'w') or die("can't open file");
fwrite($ourFileHandle, $bodytxt);
fclose($ourFileHandle);
Thanks in advance