Exemple #1
0
//************************************************
//************************************************
//************************************************
// NAO USAR!!!!!! APENAS PARA REFERENCIA!!!!!
//************************************************
//************************************************
//************************************************
//************************************************
//************************************************
//************************************************
//************************************************
$authenticator = new Authenticator();
if ($authenticator->isValidRequest()) {
    LOGS("Valid Request! Getting the data...");
    //Getting the data from the request
    $json = json_decode($authenticator->getDecryptedBody(), TRUE);
    //Saving the user data.
    $database = new DataBase();
    $result = $database->saveUserEmail($json['email'], $json['country']);
    if ($result == null) {
        LOGS("Problems in reading DB...");
        header("HTTP/1.0 500 Internal server error");
    } else {
        //Sending the email
        $subject = "Requested Results from Universal Lotto generator";
        $message = "<html><body>\n";
        $message .= "<a href=\"http://jedevmobile.com\"><img src=\"http://jedevmobile.com/images/JE_logo_medium.png\" alt=\"JEDevMobile\" /></a>\n";
        $message .= "<h1>Thank You for using our app!</h1>\n";
        $message .= "<h2>These are the results requested:</h2>\n";
        $message .= "<table border=\"3\" style=\"border-color: #003250;\" cellpadding=\"10\">\n";
        $oddLine = true;