Visualizzazione dei risultati da 1 a 7 su 7
  1. #1

    problemi con un form mail..Grazie di cuore

    salve a tutti non riesco a far funzionare questo form:

    http://www.togirastudio.com/form.swf

    che è collegato ad un'altra pagina chiamata mailform.php che contiene qst codice:

    <?

    // Enter your email address here
    $adminaddress = "info@togirastudio.com";

    // Enter the address of your website here MUST include http://www.
    $siteaddress ="http://www.togirastudio.com";

    // Enter your company name or site name here
    $sitename = "Togira Studio";

    // Gets the date and time from your server
    $date = date("m/d/Y H:i:s");

    // Gets the IP Address
    if ($REMOTE_ADDR == "") $ip = "no ip";
    else $ip = getHostByAddr($REMOTE_ADDR);

    //Process the form data!
    // and send the information collected in the Flash form to Your nominated email address
    IF ($action != ""):
    mail("$adminaddress","Info Request",
    "FAO: Admin @ $sitename \n
    First Name: $fname
    Last Name: $lname
    Email: $vemail
    Company: $cname
    Telephone: $telno\n
    The visitor commented:
    ------------------------------
    $comments
    ------------------------------

    Logged Info :
    ------------------------------
    Using: $HTTP_USER_AGENT
    Hostname: $ip
    IP address: $REMOTE_ADDR
    Date/Time: $date","FROM:$adminaddress");


    //This sends a confirmation to your visitor
    mail("$vemail","Grazie per aver visitato $sitename", "Ciao $fname,\n
    Grazie per aver visitato $sitename!\n
    A Presto,
    $sitename
    $siteaddress","FROM:$adminaddress");

    //Confirmation is sent back to the Flash form that the process is complete
    $sendresult = "Done!";
    $send_answer = "answer=";
    $send_answer .= rawurlencode($sendresult);
    echo "$send_answer";

    ENDIF;
    ?>


    Premetto che tempo fa l'avevo provata e funzionava molto bene ora non so...............premetto anche che il php non è il mio miglio amico Mi spiegate voi che siete dei fenomeni.Grazie.

  2. #2
    Utente di HTML.it L'avatar di Il_Drugo
    Registrato dal
    May 2006
    Messaggi
    1,220
    Dovresti anche postare il codice ActionScript dell'SWF...altrimenti se l'errore fosse li non lo sapremmo mai ^^


  3. #3

    nel pulsante invia

    on (release) {
    if ((vemail.indexOf("@") != -1) && (vemail.indexOf(".") != -1) && (length(vemail)>5)) {
    action = "Send";
    loadVariablesNum("mailform.php", 0, "POST");
    nextFrame();
    } else {
    vemail = "inserisci la tua email";
    action = "";
    stop();
    }
    }

  4. #4

    poi anche

    primo fotogramma) fscommand ("allowscale", "false");
    mailform = "mailform.php";
    action = "";
    stop ();



    2 fotogramma) loadVariablesNum(mailform, 0);
    answer = "La tua Email è stata\r\ninviata con successo\r\n\r\nGrazie per averci contattato\r\nTi risponderemo al più presto";
    stop();

  5. #5
    Utente di HTML.it L'avatar di Il_Drugo
    Registrato dal
    May 2006
    Messaggi
    1,220
    Stai usando un approccio per me molto strano.

    Io uso le LoadVars...ci caccio dentro i valori e le passo al file PHP ch epoi mi da un risultato che riporto nel filmato di flash.

    Il LoadVarsNum come fai tu non l'ho mai usato quindi non posso esserti molto d'aiuto.


  6. #6
    me ne dai qlc che io possa usare con facilità? io ci capisko poco.

    Grazie

  7. #7
    Utente di HTML.it L'avatar di Il_Drugo
    Registrato dal
    May 2006
    Messaggi
    1,220
    CODICE ActionScript (da mettere nel tasto "invia"):

    on (press)
    {
    if (form.nome.text == "" || form.mail.text == "" || form.agenzia.text == "" || form.messaggio.text == "")
    {
    getURL("javascript:alert('Attenzione: è necessario compilare tutti i campi')");
    }
    else
    {
    mail=new LoadVars()
    mail.nome = form.nome.text;
    mail.agenzia = form.azienda.text;
    mail.mail = form.mail.text;
    mail.messaggio = form.messaggio.text;

    mail.onLoad=function()
    {
    _global.sent = this["sent"];
    if(_global.sent == "si")
    {
    getURL("javascript:alert('Mail inviata con successo')");
    form.nome.text = "";
    form.agenzia.text = "";
    form.mail.text = "";
    form.messaggio.text = "";
    }
    else
    {
    getURL("javascript:alert('Si è verificato un errore durante l'invio. Riprovare piu tardi')");
    }
    }

    mail.sendAndLoad("email.php" ,mail, "post");
    }
    }
    email.php

    Codice PHP:
    <?php

    $sendTo 
    "info@togirastudio.com";
    $subject "e-mail proveniente dal sito";

    $headers "From: " $_POST["nome"];
    $headers .= "<" $_POST["mail"] . ">\r\n";
    $headers .= "Reply-To: " $_POST["mail"] . "\r\n";
    $headers .= "Return-Path: " $_POST["mail"];
    $message $_POST["messaggio"] . "\n------------------------\n mittente: " $_POST["nome"] . "\n agenzia: " $_POST["agenzia"] . "\n email: " $_POST["mail"];


    if(
    mail($sendTo$subject$message$headers))
    {
        print(
    "&sent=si");
    }
    else
    {
        print(
    "&sent=no");
    }

    ?>
    E' forse un po scarno e manca il controllo alla mail, ma è efficacie^^


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 © 2024 vBulletin Solutions, Inc. All rights reserved.