Acutally, I just noticed something. It's storing everythign into the storage.txt file correctly. Nothing is getting cut off there, but the actual .html file has stuff cut off. The more you add, the more gets cut off from the bottom.
storage file:
http://ohshi.dyndns.org/php/storage.txt
html file:
http://ohshi.dyndns.org/feel/
and this is the current php file (I realize some of the reading from the file stuff is a little redundant at the end, I'll probably fix that as soon as I figure out what's causing this problem)
Code: Select all
<html><body>
<?php
$title = htmlentities( $_POST['title'], ENT_QUOTES );
$content = htmlentities( $_POST['content'], ENT_QUOTES );
$pass = htmlentities( $_POST['pass'], ENT_QUOTES );
$filename = "storage.txt";
if ( md5( $pass ) == "e5ca581bddbcf65b33a497e66e467765" ) {
echo "You posted " . $title . " <br> " . $content . " <br>";
// read
$fh = fopen( $filename, 'r' );
$currentdata = fread( $fh, filesize( $filename ) );
fclose( $fh );
// write
$fh = fopen( $filename, 'w' ) or die( "can't open file" );
fwrite( $fh, "
<p>
<table width='80%' align='center'>
<tr>
<td>
<font class='heading'>" );
fwrite( $fh, $title );
fwrite( $fh, "<br></font><hr>" );
fwrite( $fh, $content );
fwrite( $fh, "<br></td></tr></table></p><br>" );
fwrite( $fh, $currentdata );
fclose( $fh );
// open the storage file again to grab the new content
$fh = fopen( $filename, 'r' );
$content = fread( $fh, filesize( $filename ) );
fclose( $fh );
$fh = fopen( "../feel/index.html", 'w' );
fwrite( $fh, "<html>
<head>
<title>feel</title>
<LINK REL=StyleSheet HREF='http://ohshi.dyndns.org/testingground/assets/tanasinn.css' TYPE='text/css'>
</head>
<body background='http://ohshi.dyndns.org/testingground/assets/tanasinn.gif'>
<center>
<a href='http://ohshi.dyndns.org/'><img src='http://ohshi.dyndns.org/testingground/assets/doraemonbarbroken.png' width='600' height=93 border=0></img></a>
</center>
<br>
<br> ");
fwrite( $fh, $content );
fwrite( $fh, "</html></body>" );
fclose($fh);
}
else {
echo "GET OUT";
}
?>
</body></html>