<?php
session_start();
if($_SESSION['name']){

$file_name= $_GET['name'];
$file_read = fopen($file_name,'r') or die ("Unable to read file");
$contents = fread($file_read, filesize($file_name)+1);
fclose($file_read);
}
else header('Location: index.php');

?>

<html>
<form action="edit_file.php" method="post">
<center>
<br><br><textarea name="edit" cols="90" rows="20" style="color:#8AFB17; border style:solid; background-color:#0C090A; font-size:20; font-family:DejaVu Sans Mono"><?php echo $contents; ?></textarea><p>
<input type="hidden" name="file_name" value="<?php echo $file_name; ?>">
<input type="submit" value="Save">
</center>
</form>
<form action="workArea.php" >
<center>
  <input type="submit" name="submit" value="Cancel">
  </center>
</form>
</html>

