ho questo codice in flash:
e la pagina php che riceve i dati:codice:stop(); campi = new Array("nome", "email", "tel", "city", "prod", "dim", "forma", "msg", "esito"); larghezzaCampi = 185; bordino_n = 0x666666; bordino_s = 0x000000; sfondo_n = 0xCCCCCC; sfondo_s = 0x999999; colore_n = 0x000000; colore_s = 0xFFFFFF; for (i=0; i<campi.length; i++) { with (eval(campi[i])) { border = true; _width = larghezzaCampi; borderColor = bordino_n; background = true; backgroundColor = sfondo_n; textColor = colore_n; } } Selection.setFocus(eval(campi[0])); TextField.prototype.onSetFocus = function() { this.borderColor = bordino_s; this.backgroundColor = sfondo_s; this.textColor = colore_s; }; TextField.prototype.onKillFocus = function() { this.borderColor = bordino_n; this.backgroundColor = sfondo_n; this.textColor = colore_n; }; //MovieClip.prototype.useHandCursor = false; this.pulscancella.onRelease = function() { for (i=0; i<campi.length; i++) { eval(campi[i]).text = ""; } }; this.pulsinvio.onRelease = function() { dati = new LoadVars(); // al rilascio del pulsante invio, creo un nuovo oggetto loadVars() campiVuoti = false; // imposto la variabile campiVuoti su false (ossia non ci sono campi vuoti) for (i=0; i<(campi.length-1); i++) { // scorro l’array campi escluso l’ultimo, che sarebbe il campo esito if (eval(campi[i]).text == "") { // se il campo è vuoto campiVuoti = true; // imposto campiVuoti true break; // ed interrompo il ciclo for } dati[campi[i]] = eval(campi[i]).text; // altrimenti assegno all’oggetto dati.nomeCampo il rispettivo valore } if (!campiVuoti) { // se campiVuoti è false (ossia tutti i campi sono stati riempiti) dati.flashMAIL = true; //creiamo la variabile flashMAIL in modo da far capire alla pagina php che //i dati arrivano da flash dati.onLoad = function(ok) { if (ok) { if (this.ris == "ok") { // se ris (variabile ti ritorno dalla pagina php) è ok esito.text = "l'e-mail è stata inviata correttamente"; // significa che l’e-mail è stata inviata e lo indico nel campo di testo esito for (i=0; i<(campi.length-1); i++) { eval(campi[i]).text = ""; // svuoto tutti gli altri campi di input } } else { esito.text = "l'e-mail non è stata inviata"; // se ris non è uguale a ok, l’e-mail non è stata inviata } } else { esito.text = "errore durante l'invio dei dati"; // se php non mi ritorna alcun dato, si è verificato un errore (probabilmente la pagina // non è stata trovata o c’è un errore nella pagina } delete dati; // elimino l’oggetto dati }; dati.sendAndLoad("preventivo.php", dati, "POST"); // invio i dati alla pagina php con il metodo POST e ricevo i dati nell’oggetto dati } else { delete dati; // elimino l’oggetto dati esito.text = "Tutti i campi sono obbligatori"; // avvisiamo l’utente che tutti i campi sono obbligatori } }; this.pulscancella.onRollOver = function() { _root.movcancella.gotoAndPlay("s1"); }; this.pulscancella.onRollOut = this.pulscancella.onReleaseOutside=function () { _root.movcancella.gotoAndPlay("s2"); }; this.pulsinvio.onRollOver = function() { _root.movinvio.gotoAndPlay("s1"); }; this.pulsinvio.onRollOut = this.pulsinvio.onReleaseOutside=function () { _root.movinvio.gotoAndPlay("s2"); };
il campo forma lo vorrei sostituire con un radio button...codice:<? if(isset($_POST['flashMAIL'])){ ////////////////////////////////////////////// $nome = htmlspecialchars(stripslashes(utf8_decode(trim($_POST['nome']))),ENT_QUOTES); $email = htmlspecialchars(stripslashes(utf8_decode(trim($_POST['email']))),ENT_QUOTES); $tel = htmlspecialchars(stripslashes(utf8_decode(trim($_POST['tel']))),ENT_QUOTES); $city = htmlspecialchars(stripslashes(utf8_decode(trim($_POST['city']))),ENT_QUOTES); $prod = htmlspecialchars(stripslashes(utf8_decode(trim($_POST['prod']))),ENT_QUOTES); $dim = htmlspecialchars(stripslashes(utf8_decode(trim($_POST['dim']))),ENT_QUOTES); $forma = htmlspecialchars(stripslashes(utf8_decode(trim($_POST['forma']))),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.SITI.IT"; $to = "info@sito.it"; ////////////////////////////////////////////// $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">Telefono:</td> <td align="center" class="tdDX">'.$tel.'</td> </tr> <tr> <td align="center" class="tdSX">Città:</td> <td align="center" class="tdDX">'.$city.'</td> </tr> <tr> <td align="center" class="tdSX">Prodotto interessato:</td> <td align="center" class="tdDX">'.$prod.'</td> </tr> <tr> <td align="center" class="tdSX">Dimensioni:</td> <td align="center" class="tdDX">'.$dim.'</td> </tr> <tr> <td align="center" class="tdSX">Breve descrizione della situazione:</td> <td align="center" class="tdDX">'.$msg.'</td> </tr> <tr> <td align="center" class="tdSX">Forma:</td> <td align="center" class="tdDX">'.$forma.'</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"; } ?>
però non so come modificare il codice...
inoltre l'swf così pesa 9 k se inserisco il componente radio button va a 118kVVoVe:
qualcuno sa darmi qualche dritta

VVoVe:
Rispondi quotando