Exemplo n.º 1
0
        }
        $mail->setSubject("Sent via Readability: {$pageTitle}");
        try {
            if (!$mail->send()) {
                Readability::logMessage("ERROR:There was an error sending to kindle. POST: " . print_r($_POST, true));
            } else {
                $page = 'complete';
            }
        } catch (Exception $e) {
            Readability::logMessage("ERROR:There was an exception sending the email. POST: " . print_r($_POST, true));
            Readability::logMessage("ERROR:" . $e->getMessage());
        }
        //header('location: close.html');
    }
} elseif ('get' == strtolower($_SERVER['REQUEST_METHOD'])) {
    $_SESSION['secureKey'] = Readability::generateSecureKey();
}
class Readability
{
    public static function isError($field, $errors)
    {
        if (in_array($field, $errors)) {
            return TRUE;
        }
        return FALSE;
    }
    public static function getErrorClass($field, $errors)
    {
        if (in_array($field, $errors)) {
            return 'class = "error"';
        }