|
newfile_nameerror = "Please enter a valid file name"; |
|
} |
|
else { |
|
$newfile_nameerror = ""; |
|
} |
|
} |
|
else { |
|
$newfile_nameerror = ""; |
|
} |
|
|
|
if (isset($_POST['newfile_content'])) { |
|
$newfile_content = $_POST['newfile_content']; |
|
if (empty($newfile_content)) { |
|
$newfile_contenterror = "Please enter a valid file content"; |
|
} |
|
else { |
|
$newfile_contenterror = ""; |
|
} |
|
} |
|
else { |
|
$newfile_contenterror = ""; |
|
} |
|
|
|
if ($newfile_nameerror == "" && $newfile_contenterror == "") { |
|
$newfile = fopen($newfile_name, "w"); |
|
fwrite($newfile, $newfile_content); |
|
fclose($newfile); |
|
header("Location: index.php"); |
|
} |
|
} |