marcus Posted October 16, 2006 Share Posted October 16, 2006 ok, here is my code[code]<?php$loadcontent = "$_GET[page]";if($save_file) {$savecontent = stripslashes($savecontent);$fp = @fopen($loadcontent, "w");if ($fp) {fwrite($fp, $savecontent);fclose($fp);}}$fp = @fopen($loadcontent, "r");$loadcontent = fread($fp, filesize($loadcontent));$loadcontent = htmlspecialchars($loadcontent);fclose($fp);?><form method=post action="<?=$_SERVER[PHP_SELF]?>"><textarea name="savecontent" cols="70" rows="25"><?=$loadcontent?></textarea><br><input type="submit" name="save_file" value="Save"></form>[/code]and here is the error i get[code]Warning: fread(): supplied argument is not a valid stream resource in /home/neoblob/public_html/php/3/edit.php on line 12Warning: fclose(): supplied argument is not a valid stream resource in /home/neoblob/public_html/php/3/edit.php on line 14[/code] Link to comment https://forums.phpfreaks.com/topic/24041-help-with-file-editing-found-a-script/ Share on other sites More sharing options...
Recommended Posts