Skip to content

Instantly share code, notes, and snippets.

@kmill
Created February 10, 2018 20:00
Show Gist options
  • Save kmill/0339e61ab6690aa2649668a87e9f48e1 to your computer and use it in GitHub Desktop.
Save kmill/0339e61ab6690aa2649668a87e9f48e1 to your computer and use it in GitHub Desktop.
<?php
$parts = explode("\n", $_POST['msg'], 2);
$msg = $parts[0];
if (strlen($msg) > 0) {
$f = fopen("messages.txt", "a") or die("Unable to open file");
fwrite($f, $msg . "\n");
fclose($f);
}
echo "Success";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment