1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<?php session_start(); if($_SESSION['name']){ $edit = $_POST['edit']; $file_name = $_POST['file_name']; $file = fopen($file_name,'w') or die ("Unable to load file"); //chmod($file, 0777); fwrite($file,$edit); fclose($file); header('Location: workArea.php'); } else header('Location: index.php'); ?>