php - Cannot edit the file -
<?php $filename = "changelog.txt"; $newdata = $_post['newd']; if ($newdata != '') { $fw = fopen($filename, 'w') or die('could not open file! error 1'); $fb = fwrite($fw,stripslashes($newdata)) or die('could not write file'); fclose($fw); } $fh = fopen($filename, "r") or die("could not open file!"); $data = fread($fh, filesize($filename)) or die("could not read file! error 2"); fclose($fh); echo "<form action='$_server[php_self]' method= 'post' > <textarea name='newd' cols='100%' rows='50'> $data </textarea> <input type='submit' value='change'> </form>"; ?> so found code google add file editor, shows file editor, when add new line , click change, says "could not open file...