<?php
session_start();
if($_SESSION['name']){
$pre_file_name = $_POST['name'];
$ext = ".html";
$file_name = $pre_file_name.$ext;

fopen($file_name,'w') or die ("Unable to create file");
//chmod($file_name, 0777);
}
else header('Location: index.php');

?>

<html>
<form action="edit_file.php" method="post">
<center>
Enter Text:<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"></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>
