Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (isset($_POST) && isset($_POST["text"]) && isset($_POST["filename"])) {
- $myfile = fopen($_POST["filename"].".txt", "w") or die("Unable to open file!");
- $txt = $_POST["text"];
- fwrite($myfile, $txt);
- fclose($myfile);
- } else {
- die('either text or filename isn\'t set');
- }
Advertisement
Add Comment
Please, Sign In to add comment