$data = $_GET['content'];
$basename = 'base.txt';
if ($data!=""){} else{exit;};
if ($data==="base"){
$text = file_get_contents($basename);
$text = htmlspecialchars_decode($text);
echo $text;exit;};
if ($data==="clear"){
$fp = fopen($basename, 'a');
ftruncate($fp, 0);
fclose (fp);
exit;};
if (file_exists($basename)===false){
$fp = fopen($basename, "w");
fwrite($fp, $data."\r\n");
fclose(fp);
exit;};
if ( is_writable($basename)){
$fh = fopen($basename, "a+");
$success - fwrite($fh, $data."\r\n");
fclose($fh);
exit;}
?>