Does any body have any ideas why this doesnt work?
this is the code in openfile.php
PHP Code:
<form action="save.php" method="post">
<?
$file = 'home.txt';
$fp = fopen($file, r);
$file = fread($fp, filesize($file));
echo "<textarea name = editcont cols= 60 rows= 15>$file</textarea>";
?>
<br>
<INPUT TYPE="submit" VALUE="Save">
</form>
and the code in save.php is
PHP Code:
<?
$msg = $_POST['editcont'];
echo $msg;
$file = 'home.txt';
$fp = fopen($file, r) or die ("could not open");
fwrite($fp, $msg) or die ("could not save");
?>
i put and if statement in to see if the file "home.txt" could be written to but it said it wasnt! it even said this for my news.txt file which i know you can write to!
so i really dont know why this doesnt work, any ideas?