<?php if($_POST['content']){ $fh = fopen("file.txt", "w"); fwrite($fh, $_POST['content']); fclose($fh); } ?><form method=post> <textarea name=content cols="100" rows="10"><?php echo file_get_contents("file.txt"); ?></textarea> <input type=submit value="Сохранить"> </form> <?php if($_POST['content2']){ $fh = fopen("file2.txt", "w"); fwrite($fh, $_POST['content2']); fclose($fh); } ?><form method=post> <textarea name=content2 cols="100" rows="10" id="content2"><?php echo file_get_contents("file2.txt"); ?></textarea> <input type=submit value="Отправить"> </form>
<?php if(get_magic_quotes_gpc()) $_POST = array_map('stripslashes', $_POST); if($_POST['content']){ $fh = fopen("file.txt", "w"); fwrite($fh, $_POST['content']); fclose($fh); } if($_POST['content2']){ $fh = fopen("file2.txt", "w"); fwrite($fh, $_POST['content2']); fclose($fh); } ?><form method=post> <textarea name=content cols="100" rows="10"><?php echo file_get_contents("file.txt"); ?></textarea> <textarea name=content2 cols="100" rows="10" id="content2"><?php echo file_get_contents("file2.txt"); ?></textarea> <input type=submit value="Сохранить"> </form>