glenelkins Posted October 16, 2006 Share Posted October 16, 2006 i cant see whats wrong with this?? (Warning: fread(): Length parameter must be greater than 0. in c:\program files\easyphp1-8\www\fileeditor\edit.php on line 19)[code]<? // Get the file $file = $_GET['file']; // Check if file is empty if (empty($file)) { echo "Please Enter A File Name"; exit(); } // Open the file for writing if(!($file_handle = fopen($file,"r"))) { echo "Cannot Read File"; exit(); } // Read the contents of the file $file_contents = fread($file_handle,filesize($file)); // Display The File // In a form?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/24085-strange-file-read-problem/ Share on other sites More sharing options...
Daniel0 Posted October 16, 2006 Share Posted October 16, 2006 Should work if the file exists. You can use file_exists to check that. Quote Link to comment https://forums.phpfreaks.com/topic/24085-strange-file-read-problem/#findComment-109460 Share on other sites More sharing options...
glenelkins Posted October 16, 2006 Author Share Posted October 16, 2006 No worries the file being inputted into the script for some reason didnt save more than 0bytes...wierd Quote Link to comment https://forums.phpfreaks.com/topic/24085-strange-file-read-problem/#findComment-109461 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.