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

    Chi mi puo' aiutare

    Ciao a tutti sono nuovo del forum.Ho un problema con un form flash + PHP.Sia il codice flash che il codice php non sono miei ma sono di quei template che si acquistano gia' fatti ma modificabili.Il mio problema è che in flash c'è il form con input Nome,Email,Telefono,Messaggio con il pulsante invia che richiama la pagina email.php.Una volta pubblicato,quando inserisco gli imput mi arriva una mail così:da Roberto a gus53@fastwebnet.it The Name Of The Sender: 1
    Email: Roberto

    Subject:

    Message:

    IP ADDRESS: 93.50.171.20

    By Gus Web Design Studio

    Non viene spedito il Subject e il Messaggio

    Io non capisco il linguaggio php mi date una mano ? Qui di seguito il codice di email.php:

    <?php
    //Type the receiever's e-mail address
    $emailAddress = "gus53@fastwebnet.it";
    //Type your Site Name
    $siteName = "By Gus Web Design Studio";

    $contact_name = $_POST['name'];
    $contact_email = $_POST['email'];
    $contact_subject = $_POST['subject'];
    $contact_message = $_POST['message'];

    if( $contact_name = true ) {
    $sender = $contact_email;
    $receiver = $emailAddress;

    $client_ip = $_SERVER['REMOTE_ADDR'];

    $email_body = "The Name Of The Sender: $contact_name \nEmail: $sender \n\nSubject: $contact_subject \n\nMessage: \n\n$contact_message \n\nIP ADDRESS: $client_ip \n\n$siteName";

    $emailAutoReply = "Hi $contact_name, \n\nWe have just received your E-Mail. We will get in touch in a few days. Thank you! \n\n$siteName ";


    $extra = "From: $sender\r\n" . "Reply-To: $sender \r\n" . "X-Mailer: PHP/" . phpversion();
    $autoReply = "From: $receiver\r\n" . "Reply-To: $receiver \r\n" . "X-Mailer: PHP/" . phpversion();

    mail( $sender, "Auto Reply: $contact_subject", $emailAutoReply, $autoReply );

    if( mail( $receiver, "New E-Mail - $contact_subject", $email_body, $extra ) ) {
    echo "success=yes";
    } else {
    echo "success=no";
    }
    }
    ?>
    by Gus

  2. #2
    Evidentemente:

    Codice PHP:
    ...
    $contact_subject $_POST['subject'];
    $contact_message $_POST['message'];
    ... 
    non sono valorizzati.
    "Mai discutere con un idiota. Ti trascina al suo livello e ti batte con l'esperienza." (Oscar Wilde)

  3. #3

    php

    Ma per valorizzarli cosa devo fare ? Se si puo' fare.Grazie Roberto
    by Gus

  4. #4
    Beh una prima cosa da controllare è che i nomi dei parametri passati da flash alla pagina PHP siano effettivamente: "subject" e "message"
    "Mai discutere con un idiota. Ti trascina al suo livello e ti batte con l'esperienza." (Oscar Wilde)

  5. #5
    Grazie ora provo a vedere se riesco a fare qualcosa! Se non riesco provero' a scrivere ancora.Per il momento ti ringrazio tanto.
    by Gus

  6. #6
    Questo è il codice flash per me arabo!




    function clearField2()
    {
    txtField4.text = label1;
    if (_currTextField == String(txtField4))
    {
    txtField4.text = "";
    } // end if
    } // End of the function
    function clearField()
    {
    txtField1.text = "";
    txtField2.text = "";
    txtField3.text = "";
    } // End of the function
    selection;
    label1 = "Message:";
    var _currTextField = "";
    txtField1.tabIndex = 0;
    txtField2.tabIndex = 1;
    txtField3.tabIndex = 2;
    txtField4.tabIndex = 3;
    txtField4.onSetFocus = function ()
    {
    _currTextField = String(txtField4);
    if (this.text == label1)
    {
    this.text = "";
    } // end if
    };
    txtField4.onKillFocus = function ()
    {
    if (this.text == "")
    {
    this.text = label1;
    } // end if
    _currTextField = "";
    };
    clearField();
    clearField2();
    btnClear.onRollOver = function ()
    {
    this.gotoAndPlay("over");
    };
    btnClear.onRollOut = btnClear.onReleaseOutside = function ()
    {
    this.gotoAndPlay("out");
    };
    btnClear.onRelease = function ()
    {
    clearField2();
    clearField();
    };
    btnSubmit.onRollOver = function ()
    {
    this.gotoAndPlay("over");
    };
    btnSubmit.onRollOut = btnSubmit.onReleaseOutside = function ()
    {
    this.gotoAndPlay("out");
    };
    btnSubmit.onRelease = function ()
    {
    if (txtField1.text == "" || txtField2.text == "" || txtField3.text == "" || txtField4.text == "")
    {
    gotoAndStop(3);
    }
    else
    {
    _parent.contactform.loadVariables("email.php", "POST");
    gotoAndStop(2);
    } // end else if
    };
    stop ();
    by Gus

  7. #7
    Utente di HTML.it L'avatar di brodik
    Registrato dal
    Jan 2009
    Messaggi
    764
    prova a sostituire nel file flash

    codice:
    if (txtField1.text == "" || txtField2.text == "" || txtField3.text == "" || txtField4.text == "")
    con

    codice:
    if (_parent.contactform.txtField1.text == "" || _parent.contactform.txtField2.text == "" || _parent.contactform.txtField3.text == "" || _parent.contactform.txtField4.text == label1)
    ovviamente potrei aver detto un gran stupidata visto le mie conoscenze di flash...

    molto probabile che i nomi da recuperare siano i vari "txtFieldX"

    in alternativa nel file php scrivi:

    Codice PHP:
    <?php
    foreach($_POST as $k => $v){
         print 
    $k." => ".$v."\n";
    }
    ?>
    e prova a spedire una mail..

    nel caso non ti sia possibile visualizzare la risposta del file php durante l'invio, modifica lo script così:

    Codice PHP:
    <?php
    $lol 
    "";
    foreach(
    $_POST as $k => $v){
         
    $lol .= $k." => ".$v."\n";
    }
    file_put_contents("debug.txt"$lol);
    ?>
    eXvision

  8. #8
    Ma leggere il regolamento pare brutto ?

    http://forum.html.it/forum/showthrea...hreadid=412253

    Il titolo della discussione DEVE avere attinenza con la richiesta che si fa.
    Per questa volta, e SOLO per questa volta, lo edito io.
    Addio Aldo, amico mio... [03/12/70 - 16/08/03]

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.