Blame view

htdocs/documents/create_file.php 746 Bytes
c10d2abc   rcavalie   ajout fichiers se...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  <?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>