added example project

This commit is contained in:
Alexander Willner
2012-01-16 02:06:09 +01:00
parent ec7f0d9ee5
commit 14f45412c5
5 changed files with 210 additions and 0 deletions

28
resources/example.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
// Author: Alex
// Description: OpenPGP.js message example
/* setup -------------------------------------------------------------------- */
define('SMALL_LIMIT',128);
define('LARGE_LIMIT',131072);
$subject="OpenPGP.js Example";
$to="alex@openpgpjs.org";
$headers = "From: OpenPGP.js Example <noreply@openpgpjs.org>\r\n";
$mail = "$message";
/* -------------------------------------------------------------------------- */
/* input -------------------------------------------------------------------- */
$user=substr(trim($_POST["mail"]), 0, SMALL_LIMIT);
$message=substr(trim($_POST["message"]), 0, LARGE_LIMIT);
/* -------------------------------------------------------------------------- */
/* send the request --------------------------------------------------------- */
if (filter_var($user, FILTER_VALIDATE_EMAIL)) {
$headers = "From: $user\r\n";
}
mail($to, $subject, $message, $headers);
/* Redirect browser */
header("Location: http://openpgpjs.org");
?>