wu981526092's picture
update (#3)
1ae558f verified
raw
history blame
757 Bytes
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");
}
}