Skip to content

Instantly share code, notes, and snippets.

@parkjinwoo
Last active December 19, 2015 23:39
Show Gist options
  • Save parkjinwoo/6036189 to your computer and use it in GitHub Desktop.
Save parkjinwoo/6036189 to your computer and use it in GitHub Desktop.
simple note
<?php
if (isset($_POST['text'])) {
$text = $_POST['text'];
$fo = fopen("./text.txt", "w") or die("can't open file");
fwrite($fo, $text);
fclose($fo);
}
$fc = file_get_contents("./text.txt");
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>simple note</title>
</head>
<body>
<form action="." method="POST">
<p>
<textarea name="text" cols="64" rows="24"><?=$fc?></textarea><br />
<input type="submit" />
</p>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment