croatiankid
03-10-2007, 08:20 PM
So I'm using this code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?
$block1 = "block1.txt";
$myblock1 = implode( file( $block1 ), "" );
$block2 = "block2.txt";
$myblock2 = implode( file( $block2 ), "" );
$block3 = "block3.txt";
$myblock3 = implode( file( $block3 ), "" );
$block4 = "block4.txt";
$myblock4 = implode( file( $block4 ), "" );
$block5 = "block5.txt";
$myblock5 = implode( file( $block5 ), "" );
$block6 = "block6.txt";
$myblock6 = implode( file( $block6 ), "" );
$block7 = "block7.txt";
$myblock7 = implode( file( $block7 ), "" );
$block8 = "block8.txt";
$myblock8 = implode( file( $block8 ), "" );
if ( $save1 ) {
$tmpfile1 = fopen( $myblock1, "w" );
$fp = fwrite( $tmpfile1, $block1t );
fclose($tmpfile1);
}
if ( $save2 ) {
$tmpfile2 = fopen( $myblock2, "w" );
$fp = fwrite( $tmpfile2, $block2t );
fclose($tmpfile2);
}
if ( $save3 ) {
$tmpfile3 = fopen( $myblock3, "w" );
$fp = fwrite( $tmpfile3, $block3t );
fclose($tmpfile3);
}
if ( $save4 ) {
$tmpfile4 = fopen( $myblock4, "w" );
$fp = fwrite( $tmpfile4, $block4t );
fclose($tmpfile4);
}
if ( $save5 ) {
$tmpfile5 = fopen( $myblock5, "w" );
$fp = fwrite( $tmpfile5, $block5t );
fclose($tmpfile5);
}
if ( $save6 ) {
$tmpfile6 = fopen( $myblock6, "w" );
$fp = fwrite( $tmpfile6, $block6t );
fclose($tmpfile6);
}
if ( $save7 ) {
$tmpfile7 = fopen( $myblock7, "w" );
$fp = fwrite( $tmpfile7, $block7t );
fclose($tmpfile7);
}
if ( $save8 ) {
$tmpfile8 = fopen( $myblock8, "w" );
$fp = fwrite( $tmpfile8, $block8t );
fclose($tmpfile8);
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>update</title>
<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
mode : "textareas"
});
</script>
</head>
<body>
<p>index</p>
<form action="update.php">
<p><textarea name="block1t" rows=35 cols=70><? echo $myblock1 ?></textarea></p>
<br>
<p><input type="submit" name="save1" value="save"></p>
</form>
<form action="update.php">
<p><textarea name="block2t" rows=35 cols=70><? echo $myblock2 ?></textarea></p>
<br>
<p><input type="submit" name="save2" value="save"></p>
</form>
<form action="update.php">
<p><textarea name="block3t" rows=35 cols=70><? echo $myblock3 ?></textarea></p>
<br>
<p><input type="submit" name="save3" value="save"></p>
</form>
<form action="update.php">
<p><textarea name="block4t" rows=35 cols=70><? echo $myblock4 ?></textarea></p>
<br>
<p><input type="submit" name="save4" value="save"></p>
</form>
<p>construction</p>
<form action="update.php">
<p><textarea name="block5t" rows=35 cols=70><? echo $myblock5 ?></textarea></p>
<br>
<p><input type="submit" name="save5" value="save"></p>
</form>
<form action="update.php">
<p><textarea name="block6t" rows=35 cols=70><? echo $myblock6 ?></textarea></p>
<br>
<p><input type="submit" name="save6" value="save"></p>
</form>
<form action="update.php">
<p><textarea name="block7t" rows=35 cols=70><? echo $myblock7 ?></textarea></p>
<br>
<p><input type="submit" name="save7" value="save"></p>
</form>
<form action="update.php">
<p><textarea name="block8t" rows=35 cols=70><? echo $myblock8 ?></textarea></p>
<br>
<p><input type="submit" name="save8" value="save"></p>
</form>
</body>
</html>
invalid xhtml aside, I get Warning: fopen(<h3>Welcome to our website!</h3> <p>Welcome to our website where we are committed to serving you with all your eyecare needs. We have designed this website with YOU in mind.</p> <p>There are many areas of the site that you can explore. For example, under the health page, you can find out great information about keeping your eyes healthy and avoiding most problems. You can also use the contact form to speak directly with a doctor.</p>) [function.fopen]: failed to open stream: No such file or directory in update.php on line 30
Warning: fwrite(): supplied argument is not a valid stream resource in update.php on line 31
Warning: fclose(): supplied argument is not a valid stream resource in update.php on line 32
when i edit and submit the first field. Also my tinymce isn't working, but i want to fix the php thing first.
line 30 is $tmpfile1 = fopen( $myblock1, "w" );
<html xmlns="http://www.w3.org/1999/xhtml">
<?
$block1 = "block1.txt";
$myblock1 = implode( file( $block1 ), "" );
$block2 = "block2.txt";
$myblock2 = implode( file( $block2 ), "" );
$block3 = "block3.txt";
$myblock3 = implode( file( $block3 ), "" );
$block4 = "block4.txt";
$myblock4 = implode( file( $block4 ), "" );
$block5 = "block5.txt";
$myblock5 = implode( file( $block5 ), "" );
$block6 = "block6.txt";
$myblock6 = implode( file( $block6 ), "" );
$block7 = "block7.txt";
$myblock7 = implode( file( $block7 ), "" );
$block8 = "block8.txt";
$myblock8 = implode( file( $block8 ), "" );
if ( $save1 ) {
$tmpfile1 = fopen( $myblock1, "w" );
$fp = fwrite( $tmpfile1, $block1t );
fclose($tmpfile1);
}
if ( $save2 ) {
$tmpfile2 = fopen( $myblock2, "w" );
$fp = fwrite( $tmpfile2, $block2t );
fclose($tmpfile2);
}
if ( $save3 ) {
$tmpfile3 = fopen( $myblock3, "w" );
$fp = fwrite( $tmpfile3, $block3t );
fclose($tmpfile3);
}
if ( $save4 ) {
$tmpfile4 = fopen( $myblock4, "w" );
$fp = fwrite( $tmpfile4, $block4t );
fclose($tmpfile4);
}
if ( $save5 ) {
$tmpfile5 = fopen( $myblock5, "w" );
$fp = fwrite( $tmpfile5, $block5t );
fclose($tmpfile5);
}
if ( $save6 ) {
$tmpfile6 = fopen( $myblock6, "w" );
$fp = fwrite( $tmpfile6, $block6t );
fclose($tmpfile6);
}
if ( $save7 ) {
$tmpfile7 = fopen( $myblock7, "w" );
$fp = fwrite( $tmpfile7, $block7t );
fclose($tmpfile7);
}
if ( $save8 ) {
$tmpfile8 = fopen( $myblock8, "w" );
$fp = fwrite( $tmpfile8, $block8t );
fclose($tmpfile8);
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>update</title>
<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
mode : "textareas"
});
</script>
</head>
<body>
<p>index</p>
<form action="update.php">
<p><textarea name="block1t" rows=35 cols=70><? echo $myblock1 ?></textarea></p>
<br>
<p><input type="submit" name="save1" value="save"></p>
</form>
<form action="update.php">
<p><textarea name="block2t" rows=35 cols=70><? echo $myblock2 ?></textarea></p>
<br>
<p><input type="submit" name="save2" value="save"></p>
</form>
<form action="update.php">
<p><textarea name="block3t" rows=35 cols=70><? echo $myblock3 ?></textarea></p>
<br>
<p><input type="submit" name="save3" value="save"></p>
</form>
<form action="update.php">
<p><textarea name="block4t" rows=35 cols=70><? echo $myblock4 ?></textarea></p>
<br>
<p><input type="submit" name="save4" value="save"></p>
</form>
<p>construction</p>
<form action="update.php">
<p><textarea name="block5t" rows=35 cols=70><? echo $myblock5 ?></textarea></p>
<br>
<p><input type="submit" name="save5" value="save"></p>
</form>
<form action="update.php">
<p><textarea name="block6t" rows=35 cols=70><? echo $myblock6 ?></textarea></p>
<br>
<p><input type="submit" name="save6" value="save"></p>
</form>
<form action="update.php">
<p><textarea name="block7t" rows=35 cols=70><? echo $myblock7 ?></textarea></p>
<br>
<p><input type="submit" name="save7" value="save"></p>
</form>
<form action="update.php">
<p><textarea name="block8t" rows=35 cols=70><? echo $myblock8 ?></textarea></p>
<br>
<p><input type="submit" name="save8" value="save"></p>
</form>
</body>
</html>
invalid xhtml aside, I get Warning: fopen(<h3>Welcome to our website!</h3> <p>Welcome to our website where we are committed to serving you with all your eyecare needs. We have designed this website with YOU in mind.</p> <p>There are many areas of the site that you can explore. For example, under the health page, you can find out great information about keeping your eyes healthy and avoiding most problems. You can also use the contact form to speak directly with a doctor.</p>) [function.fopen]: failed to open stream: No such file or directory in update.php on line 30
Warning: fwrite(): supplied argument is not a valid stream resource in update.php on line 31
Warning: fclose(): supplied argument is not a valid stream resource in update.php on line 32
when i edit and submit the first field. Also my tinymce isn't working, but i want to fix the php thing first.
line 30 is $tmpfile1 = fopen( $myblock1, "w" );