Visualizzazione dei risultati da 1 a 3 su 3

Discussione: allegato flash php

  1. #1
    Utente di HTML.it
    Registrato dal
    Sep 2007
    Messaggi
    26

    allegato flash php

    Questo è il mio problema:

    Ho fatto un programmino in flash, che alla fine, grazie alla funzione getColorBoundsRect(); mi restituisce una immagine, ho creato un form mail, cioè ho creato delle caselle input nome, e-mail, oggetto, msg e il tutto è funzionante.
    Ho visto che per mandare le variabili da flash a php basta dare delle istanze alle caselle di testo e poi richiamarle dal php.
    Adesso vorrei che gli utenti mi spedissero l'immagine che restituisce la funzione getColorBoundsRect(); con il form, come faccio a mandare l'immagine al php? e come devo modificare il php?

    php:

    <?
    if(isset($_POST['flashMAIL'])){
    $nome = htmlspecialchars(stripslashes(utf8_decode(trim($_P OST['nome']))),ENT_QUOTES);
    $email = htmlspecialchars(stripslashes(utf8_decode(trim($_P OST['email']))),ENT_QUOTES);
    $oggetto=htmlspecialchars(stripslashes(utf8_decode (trim($_POST['oggetto']))),ENT_QUOTES);
    $msg = nl2br(stripslashes(utf8_decode(trim($_POST['msg']))));
    $msg = str_replace("
    ","[br]",$msg);
    $msg = htmlspecialchars($msg,ENT_QUOTES);
    $msg = str_replace("[br]","
    ",$msg);

    $page = "www.xxxxxxx.com";
    $to = "xxxx@xxxxx.com";

    $messaggio ='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>
    <title>'.$page.'</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    body {margin:0px;padding:0px;}
    table {width: 100%;font-family:Verdana, Arial, Helvetica, sans-serif;}
    .tdSX {width:40%;font-size:10px;color:#333333;}
    .tdDX {width:60%;font-size:10px;color:#000066;}
    #titolo {width: 100%;font-size:14px;color:#003366;text-decoration:underline;}
    </style>
    </head><body><table><tr><td align="center" id="titolo" colspan="2">CONTATTI '.$page.'</td></tr>
    <tr><td colspan="2"></td></tr><tr><td align="center" class="tdSX">Nome:</td><td align="center" class="tdDX">'.$nome.'</td></tr>
    <tr><td align="center" class="tdSX">E-mail:</td><td align="center" class="tdDX">'.$email.'</td></tr>
    <tr><td align="center" class="tdSX">messaggio:</td><td align="center" class="tdDX">'.$msg.'</td></tr>
    </table></body></html>';
    $intestazioni = "MIME-Version: 1.0\r\n";
    $intestazioni .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $intestazioni .= "To: ".$to."\r\n";
    $intestazioni .= "From: ".$nome." <".$email.">\r\n";
    $intestazione .= "Return-Path: ".$nome."\n";
    if (mail($to, $oggetto, $messaggio, $intestazioni)) { print "ris=ok"; } else { print "ris=error"; }
    } else {
    print "ris=error";
    }
    ?>

    Grazie, scusate per come ho spiegato le cose ma sono un neofita, vi prego di spiegare con chiarezza e molta molta pazienza

  2. #2
    Utente di HTML.it
    Registrato dal
    Sep 2007
    Messaggi
    26
    up per favore

  3. #3
    Utente di HTML.it
    Registrato dal
    Sep 2007
    Messaggi
    26
    Ho visto che per mettere spedire degli allegati basta usare un php del tipo:

    <?php
    $newfile = $_POST['thepath'];
    $fileatt = $newfile; // Path to the file from Flash variables
    $fileatt_type = "application/octet-stream"; // File Type
    $fileatt_name = $_POST['thefile']; // Filename that will be used for the file as the attachment from Flash variables
    $from = $_POST['email'];
    $email_from = $from; // Who the email is from
    $email_subject = "Info From Website"; // The Subject of the email
    $email_txt = $_POST['message']; // Message that the email has in it

    $email_to = "webmaster@yoursite.com"; // Who the email is too

    $headers = "From: ".$email_from;

    $file = fopen($fileatt,'rb');
    $data = fread($file,filesize($fileatt));
    fclose($file);

    $semi_rand = md5(time());
    $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";

    $headers .= "\nMIME-Version: 1.0\n" .
    "Content-Type: multipart/mixed;\n" .
    " boundary=\"{$mime_boundary}\"";
    $email_message .= $email_txt . "\n\n" .
    "--{$mime_boundary}\n" .
    "Content-Type:text/html; charset=\"iso-8859-1\"\n" .
    "Content-Transfer-Encoding: 7bit\n\n" .
    $email_txt . "\n\n";

    $data = chunk_split(base64_encode($data));

    $email_message .= "--{$mime_boundary}\n" .
    "Content-Type: {$fileatt_type};\n" .
    " name=\"{$fileatt_name}\"\n" .
    //"Content-Disposition: attachment;\n" .
    //" filename=\"{$fileatt_name}\"\n" .
    "Content-Transfer-Encoding: base64\n\n" .
    $data . "\n\n" .
    "--{$mime_boundary}--\n";

    $ok = @mail($email_to, $email_subject, $email_message, $headers);

    ?>

    Ma così facendo ho un altro problema:
    Come faccio a salvare sul server il bmp?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.