Please help me to open at html file from the server ,edit and save it, using php.
The code below returns a blank page i.e. no syntax errors but no output. home.htm is the exact name of the file on the server and it has 776 permisions.
$openedfile =fopen(home.htm,'r+'); //open a file on the server for reading and writing
$openedfile=file_get_contents($openedfile);
echo $openedfile;
$filesize = filesize(home.htm); //the size in bytes of the file
$filecontent= fread($openedfile, $filesize);
echo $filecontent;
//$filecontent= str_replace('var newname = '$oldname', 'var newname = '$newname'', $filecontent); //replaces name
fclose($filecontent);