Jump to content

Strange file read problem


glenelkins

Recommended Posts

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]
Link to comment
https://forums.phpfreaks.com/topic/24085-strange-file-read-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.