Example #1
0
ini_set("upload_max_filesize", "21M");
ini_set("post_max_size", "22M");
ini_set("memory_limit", "30M");
$allowedExts = array("jpg", "jpeg", "gif", "png");
if ($_FILES["arquivo"]) {
    echo "Upload: " . $_FILES["arquivo"]["name"] . "<br>";
    echo "Type: " . $_FILES["arquivo"]["type"] . "<br>";
    echo "Size: " . $_FILES["arquivo"]["size"] / 1024 . " kB<br>";
    echo "Temp file: " . $_FILES["arquivo"]["tmp_name"] . "<br>";
    $extension = end(explode(".", $_FILES["arquivo"]["name"]));
    if (($_FILES["arquivo"]["type"] == "image/gif" || $_FILES["arquivo"]["type"] == "image/jpeg" || $_FILES["arquivo"]["type"] == "image/jpeg" || $_FILES["arquivo"]["type"] == "image/png" || $_FILES["arquivo"]["type"] == "image/pjpeg") && $_FILES["arquivo"]["size"] < 20554432 && in_array($extension, $allowedExts)) {
        if ($_FILES["arquivo"]["error"] > 0) {
            die("Return Code: " . $_FILES["file"]["error"] . "<br>");
        } else {
            if (is_file($_FILES["arquivo"]["tmp_name"])) {
                if (multi_attach_mail("*****@*****.**", array($_FILES["arquivo"]["tmp_name"]), $_POST, $_FILES["arquivo"]["name"], "*****@*****.**")) {
                    unlink($_FILES["arquivo"]["tmp_name"]);
                    header("Location: http://tvratimbum.cmais.com.br/ideias-mirabolantes-sucesso");
                    //echo ">>>>OK!";
                    die;
                } else {
                    unlink($_FILES["arquivo"]["tmp_name"]);
                    header("Location: http://tvratimbum.cmais.com.br/ideias-mirabolantes-erro");
                    //echo ">>>>ERRO!";
                    die;
                }
            }
        }
    } else {
        header("Location: http://tvratimbum.cmais.com.br/ideias-mirabolantes-erro");
        //echo "Invalid file";
ini_set("post_max_size", "22M");
ini_set("memory_limit", "30M");
$allowedExts = array("jpg", "jpeg", "gif", "png", "pdf");
if ($_FILES["new_photo"]) {
    echo "Upload: " . $_FILES["new_photo"]["name"] . "<br>";
    echo "Type: " . $_FILES["new_photo"]["type"] . "<br>";
    echo "Size: " . $_FILES["new_photo"]["size"] / 1024 . " kB<br>";
    echo "Temp file: " . $_FILES["new_photo"]["tmp_name"] . "<br>";
    $extension = end(explode(".", $_FILES["new_photo"]["name"]));
    //if((($_FILES["new_photo"]["type"] == "image/gif") || ($_FILES["new_photo"]["type"] == "image/jpeg") || ($_FILES["new_photo"]["type"] == "image/jpg") || ($_FILES["new_photo"]["type"] == "image/png")|| ($_FILES["new_photo"]["type"] == "application/pdf") || ($_FILES["new_photo"]["type"] == "image/pjpeg")) && ($_FILES["new_photo"]["size"] < 20554432) && in_array($extension, $allowedExts)){
    if ($_FILES["new_photo"]["type"] == "image/gif" || $_FILES["new_photo"]["type"] == "image/jpeg" || $_FILES["new_photo"]["type"] == "image/jpg" || $_FILES["new_photo"]["type"] == "image/png" || $_FILES["new_photo"]["type"] == "application/pdf") {
        if ($_FILES["new_photo"]["error"] > 0) {
            die("Return Code: " . $_FILES["new_photo"]["error"] . "<br>");
        } else {
            if (is_file($_FILES["new_photo"]["tmp_name"])) {
                if (multi_attach_mail("*****@*****.**", array($_FILES["new_photo"]["tmp_name"], $_FILES["new_photo2"]["tmp_name"]), $_POST, array($_FILES["new_photo"]["name"], $_FILES["new_photo2"]["name"]), "*****@*****.**")) {
                    unlink($_FILES["new_photo"]["tmp_name"]);
                    header("Location: http://tvcultura.cmais.com.br/preludio/inscricoes-preludio?msg=success");
                    //echo ">>>>OK!";
                    die;
                } else {
                    unlink($_FILES["new_photo"]["tmp_name"]);
                    header("Location: http://tvcultura.cmais.com.br/preludio/inscricoes-preludio?msg=error&var=1");
                    //echo ">>>>ERRO!";
                    die;
                }
            }
        }
    } else {
        header("Location: http://tvcultura.cmais.com.br/preludio/inscricoes-preludio?msg=error&var=2");
        //echo "Invalid file";
Example #3
0
    // Output the image
    //imagejpeg($im);
    @imagedestroy($im);
}
date_default_timezone_set("Asia/Hong_Kong");
$output_file = "captured/signature" . date("Y-m-d-H-i-s-") . time() . ".png";
base64_to_jpeg($_POST["image"], $output_file);
add_ZK_mark($output_file, $output_file);
$to = $_POST["email"];
$replyemail = $_POST["replyemail"];
$replyemail = "*****@*****.**";
if (!isset($_POST["email"]) || $to == "*****@*****.**" || $replyemail == "*****@*****.**" || $to == "") {
    echo "<p>Incorrect email address...</p>";
    echo "<a href=\"index.html\">Sign and Send again!</a>";
    exit;
}
$subject = "You got a captured sigature";
$curdir = dirname($_SERVER['REQUEST_URI']) . "/";
$dir = $_SERVER['SERVER_NAME'] . $curdir;
$urlonly = geturlonly();
$body = "Signed on " . date("Y.m.d H:i:s") . "\n Zetakey Webapp - Sign and Send " . $urlonly . "\n";
//$from = "*****@*****.**";
$headers = "From: {$replyemail}" . "\r\nReply-To: {$replyemail}";
if (multi_attach_mail($to, $replyemail, $subject, $body, $output_file)) {
    //if (mail($to, $subject, $body, $headers)) {
    echo "<p>Message successfully sent to " . $to . " !</p>";
} else {
    echo "<p>Message delivery failed...</p>";
}
echo "<a href=\"index.html\">Sign and Send again!</a>";
exit;
ini_set("upload_max_filesize", "21M");
ini_set("post_max_size", "22M");
ini_set("memory_limit", "30M");
$allowedExts = array("jpg", "jpeg", "gif", "png");
if ($_FILES["arquivo"]) {
    echo "Upload: " . $_FILES["arquivo"]["name"] . "<br>";
    echo "Type: " . $_FILES["arquivo"]["type"] . "<br>";
    echo "Size: " . $_FILES["arquivo"]["size"] / 1024 . " kB<br>";
    echo "Temp file: " . $_FILES["arquivo"]["tmp_name"] . "<br>";
    $extension = end(explode(".", $_FILES["arquivo"]["name"]));
    if (($_FILES["arquivo"]["type"] == "image/gif" || $_FILES["arquivo"]["type"] == "image/jpeg" || $_FILES["arquivo"]["type"] == "image/jpeg" || $_FILES["arquivo"]["type"] == "image/png" || $_FILES["arquivo"]["type"] == "image/pjpeg") && $_FILES["arquivo"]["size"] < 20554432 && in_array($extension, $allowedExts)) {
        if ($_FILES["arquivo"]["error"] > 0) {
            die("Return Code: " . $_FILES["file"]["error"] . "<br>");
        } else {
            if (is_file($_FILES["arquivo"]["tmp_name"])) {
                if (multi_attach_mail("*****@*****.**", array($_FILES["arquivo, arquivo2"]["tmp_name, tmp_name2"]), $_POST, $_FILES["arquivo, arquivo2"]["name, name2"], "*****@*****.**")) {
                    unlink($_FILES["arquivo"]["tmp_name"]);
                    header("Location: http://tvcultura.cmais.com.br/preestreia/inscricao-efetuada-com-sucesso");
                    //echo ">>>>OK!";
                    die;
                } else {
                    unlink($_FILES["arquivo"]["tmp_name"]);
                    header("Location: http://tvcultura.cmais.com.br/preestreia/inscricao-efetuada-com-sucesso");
                    //echo ">>>>ERRO!";
                    die;
                }
            }
        }
    } else {
        header("Location: http://tvratimbum.cmais.com.br/ideias-mirabolantes-erro");
        //echo "Invalid file";