Example #1
0
 * to benefit other developers, but you are under no enforced
 * obligation to do so :)
 * 
 * Please read the accompanying LICENSE document for the full WTFPL
 * licensing text.
 */
if (!isset($_APP)) {
    die("Unauthorized.");
}
try {
    $sCampaign = Campaign::FindByUrlName($router->uParameters[1]);
} catch (NotFoundException $e) {
    $sPageContents = NewTemplater::Render("404", $locale->strings, array());
    return;
}
if (empty($_POST['email']) || User::CheckIfEmailValid($_POST['email']) == false) {
    flash_error("Please enter a valid e-mail address.");
    require "modules/landing.php";
    return;
}
if (empty($_POST['currency'])) {
    flash_error("Please pick a valid currency.");
    require "modules/landing.php";
    return;
}
if (empty($_POST['amount']) || preg_match("([0-9]*[.,][0-9]+|[0-9]+)", $_POST['amount']) == false) {
    flash_error("Please enter a valid amount.");
    require "modules/landing.php";
    return;
}
try {