Skip to content

Instantly share code, notes, and snippets.

@ConnorMcF
Created February 15, 2016 21:52
Show Gist options
  • Save ConnorMcF/4363842837bed9defcfc to your computer and use it in GitHub Desktop.
Save ConnorMcF/4363842837bed9defcfc to your computer and use it in GitHub Desktop.
<?php
try {
$myfile = fopen("test.txt", "w") or die("failed to open file rip");
$txt = $_POST["txt"];
fwrite($myfile, $txt);
fclose($myfile);
echo "true";
} catch (Exception $e) {
die("false ".$e->getMessage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment