ProgU commited on
Commit
1661e72
1 Parent(s): 267ebf3
Files changed (1) hide show
  1. new +30 -1
new CHANGED
@@ -1 +1,30 @@
1
- newfile_name
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ newfile_nameerror = "Please enter a valid file name";
2
+ }
3
+ else {
4
+ $newfile_nameerror = "";
5
+ }
6
+ }
7
+ else {
8
+ $newfile_nameerror = "";
9
+ }
10
+
11
+ if (isset($_POST['newfile_content'])) {
12
+ $newfile_content = $_POST['newfile_content'];
13
+ if (empty($newfile_content)) {
14
+ $newfile_contenterror = "Please enter a valid file content";
15
+ }
16
+ else {
17
+ $newfile_contenterror = "";
18
+ }
19
+ }
20
+ else {
21
+ $newfile_contenterror = "";
22
+ }
23
+
24
+ if ($newfile_nameerror == "" && $newfile_contenterror == "") {
25
+ $newfile = fopen($newfile_name, "w");
26
+ fwrite($newfile, $newfile_content);
27
+ fclose($newfile);
28
+ header("Location: index.php");
29
+ }
30
+ }