I have a PHP script that loads content of a 175KB file but fails at the very top of the page. (It works with smaller file as it should be!!) Here's the script snippet:
if(!file_exists($sFile) || !is_readable($sFile)) {
echo "<span style='color: #FF3333;'>Can not find/open file.</span><br />";
} else {
if(isset($_GET['content']) && is_writable($sFile)) {
$hFile = fopen($sFile, "w");
fwrite($hFile, urldecode($_GET['content']));
fclose($hFile);
}
$sContent = file_get_contents($sFile);
}
?>
<a href="<?php echo "?page=browser&path=" . dirname(realpath($sFile)); ?>" title="Back to <?php echo dirname(realpath($sFile)); ?>">
» Back to <i><?php echo dirname(realpath($sFile)); ?></i>
</a>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="GET">
<input type="hidden" name="page" value="edit" />
<input type="hidden" name="file" value="<?php echo $sFile; ?>" />
<textarea name="content" placeholder="..." style="margin: 0; padding: 0; width: 100%; height: 350px; resize: vertical;"><?php echo $sContent; ?></textarea>
<input type="submit" value="Save changes" style="width: 100%;" />
</form>