I made this script.
[B]redakcia.php
[code=php]<form method=”post” enctype=”multipart/form-data”>
<select name=”file” style=”width: 150px”>
<option value=”magazin1.txt”>M 1</option>
<option value=”magazin2.txt”>M 2</option>
</select>
<input type=”submit” name=”load” value=”Load”>
</form>
<?php
if (isset($_POST[‘load’]))
{
$fn = ($_POST[‘file’]);
include(‘box.php’);
}
if (isset($_POST[‘save’]))
{
$fn = ($_POST[‘file’]);
$content = stripslashes($_POST[‘content’]);
$fp = fopen($fn,”w”); //or die (“Error opening file in write mode!”);
fputs($fp,$content);
fclose($fp); //or die (“Error closing file!”);
}
?>
[B]box.php
[code=php]<form action=”redakcia.php” method=”post” enctype=”multipart/form-data”>
<textarea name=”content” style=”width: 600px; height: 300px;”><?php readfile($fn) ?></textarea><br />
<input type=”submit” name=”save” value=”Save”>
</form>
the script works fine until when comes to saving the data. It gives me errors. Anyone can help me to solve these problems?
how it should be, in my case, the whole form?
thx ppl